Flutter: Error "The 'Pods-Runner' target has frameworks with conflicting names" after upgraded flutter version

6.6k Views Asked by At

I cannot run my code on my own iPhone, after I upgraded my flutter project from 2.23 to 2.8 and updated all the packages, this is a project that I worked on a few months ago, and now there is a new version of flutter, so I thought it would be better to keep my SDK and the packages up to date, but I got an error saying Exception: Error running pod install when I'm trying to test it on my phone :(

Here is the error:

[!] The 'Pods-Runner' target has frameworks with conflicting names: libavcodec.framework, libavdevice.framework, libavfilter.framework, libavformat.framework, libavutil.framework, libswresample.framework, libswscale.framework, gmp.framework, gnutls.framework, libhogweed.framework, libnettle.framework, mobileffmpeg.framework, lame.framework, libilbc.framework, libogg.framework, libopencore-amrnb.framework, libsndfile.framework, libvorbis.framework, libvorbisenc.framework, libvorbisfile.framework, opus.framework, shine.framework, soxr.framework, speex.framework, twolame.framework, vo-amrwbenc.framework, and wavpack.framework.
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/xcode/target_validator.rb:67:in `verify_no_duplicate_names'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/xcode/target_validator.rb:54:in `block (2 levels) in verify_no_duplicate_framework_and_library_names'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/xcode/target_validator.rb:48:in `each_key'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/xcode/target_validator.rb:48:in `block in verify_no_duplicate_framework_and_library_names'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/xcode/target_validator.rb:47:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/xcode/target_validator.rb:47:in `verify_no_duplicate_framework_and_library_names'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/xcode/target_validator.rb:37:in `validate!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:597:in `validate_targets'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:163:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

Exception: Error running pod install

I had also tried some popular solutions on the web such as running the command:

pod install --repo-update

But I got the same error.

My podfile: Podfile screenshot

5

There are 5 best solutions below

5
On BEST ANSWER

It seems that your pod file contains old data as well so for this I'll suggest you to deintegrate pod first then reinstall it

pod deintegrate // run this command to deintegrate

then isntall the pod again

pod install

also perform flutter clean before after this process

If the above solutions doesn't work you may try these steps as well

first of all just drag and drop your IOS folder into the terminal

then clear the cache of the pod file using below command

pod cache clean --all

after the above steps just run flutter clean and flutter pub get command

and finally you just run the below command

pod install

Let me know whether it works for you or not.

7
On

Your Podfile may have an old format.

you can try formatting as like this example https://github.com/tanersener/flutter-ffmpeg/blob/master/example/ios/Podfile

Or

Try running pod install command in the ios folder.

Or

Try flutter clean

1
On

When I run into build issues like this I do 3 things. First make sure you stop any running instance of the program, then do these 3 things.

  1. Delete the (ios | android | web | macos | etc) folder entirely. Whichever one is giving you troubles, delete that folder
  2. From root of project folder run "flutter clean"
  3. From root of project folder run "flutter create ."
0
On

This will happen, once you copy the project from another project because project compatible structure not creating. so you must recreate platform folders/directories that are compatible with the Flutter project.

  1. "flutter clean"
  2. "flutter create ."
  3. "flutter run"

In the second point, don't miss the DOT with CREATE command.

0
On

Downgrading my cocoapods back to 1.11.3 work... Just a temporary fix