2

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

Ryan Wang
  • 418
  • 7
  • 23

5 Answers5

1

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.

Pedro Luz
  • 2,694
  • 4
  • 44
  • 54
Diwyansh
  • 2,961
  • 1
  • 7
  • 11
1

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 ."
TheFunk
  • 981
  • 11
  • 39
0

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

gretal
  • 1,092
  • 6
  • 14
  • Thanks for the response, I tried to format my file just like the example above but it doesn't work, and by running `pod install`, I got an error like this `[!] The 'Pods-Runner' target has frameworks with conflicting names: libavcodec.framework, libavdevice.framework, libavfilter.framework, libavformat.framework, libavutil.framework, libswresample.framework, and libswscale.framework.` – Ryan Wang Dec 14 '21 at 04:54
  • can you share Podfile? – gretal Dec 14 '21 at 05:03
  • Just edited, by setting the `global platform version` to 9.3 made the log much shorter though, but still cannot run on my iPhone. – Ryan Wang Dec 14 '21 at 05:35
  • it must work if you have edited as per example...try flutter clean. – gretal Dec 14 '21 at 05:39
  • I actually copied the whole podfile doc from the example, but the problem still exists, so I thought if it could be the problem of the flutter framework itself~ – Ryan Wang Dec 14 '21 at 05:49
  • when you upgrade the version such an error may arrises, so you can watch whats happening in the project using flutter doctor. – gretal Dec 14 '21 at 05:52
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/240141/discussion-between-ryan-wang-and-gretal). – Ryan Wang Dec 14 '21 at 15:59
0

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

i.r.b.a
  • 69
  • 3
  • 18
0

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.