13

I finished my flutter app, and i want to test it in ios device, so i used a mac laptop and i did all the installations but when i did the command "flutter run" i got this error Launching lib/main.dart on iPhone 11 Pro Max in debug mode...

 Running pod install...                                              4,0s
 CocoaPods' output:
 ↳
  Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

Finding Podfile changes
  A flutter_barcode_scanner
  A geolocator
  A google_api_availability
  A google_maps_flutter
  A location
  A location_permissions
  A shared_preferences
  A shared_preferences_macos
  A shared_preferences_web
  - Flutter

Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `flutter_barcode_scanner` from `.symlinks/plugins/flutter_barcode_scanner/ios`
-> Fetching podspec for `geolocator` from `.symlinks/plugins/geolocator/ios`
-> Fetching podspec for `google_api_availability` from `.symlinks/plugins/google_api_availability/ios`
-> Fetching podspec for `google_maps_flutter` from `.symlinks/plugins/google_maps_flutter/ios`
-> Fetching podspec for `location` from `.symlinks/plugins/location/ios`
-> Fetching podspec for `location_permissions` from `.symlinks/plugins/location_permissions/ios`
-> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
-> Fetching podspec for `shared_preferences_macos` from `.symlinks/plugins/shared_preferences_macos/ios`
-> Fetching podspec for `shared_preferences_web` from `.symlinks/plugins/shared_preferences_web/ios`

Resolving dependencies of `Podfile`
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
[!] CocoaPods could not find compatible versions for pod "flutter_barcode_scanner":
  In Podfile:
    flutter_barcode_scanner (from `.symlinks/plugins/flutter_barcode_scanner/ios`)

Specs satisfying the `flutter_barcode_scanner (from `.symlinks/plugins/flutter_barcode_scanner/ios`)` dependency were found, but they required a higher minimum deployment target.

/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/resolver.rb:94:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:986:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:984:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:410:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:234:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:233:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:156:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'

Error running pod install
Error launching application on iPhone 11 Pro Max.
James Z
  • 12,209
  • 10
  • 24
  • 44
Halima Ouatab
  • 145
  • 1
  • 3
  • 9
  • Check `flutter_barcode_scanner` plugin. I think its not installed properly. Open cmd inside project directory. `cd` into `ios` directory. Type `pod install` and then try `flutter run`. Let me know the result – Blasanka Dec 20 '19 at 01:52
  • when i run pod install i got thi error :iMac-de-imac-1D03-014:ios halima$ pod install Analyzing dependencies [!] CocoaPods could not find compatible versions for pod "flutter_barcode_scanner": In Podfile: flutter_barcode_scanner (from `.symlinks/plugins/flutter_barcode_scanner/ios`) Specs satisfying the `flutter_barcode_scanner (from `.symlinks/plugins/flutter_barcode_scanner/ios`)` dependency were found, but they required a higher minimum deployment target – Halima Ouatab Dec 20 '19 at 02:13
  • Try `flutter clean` and then `flutter pub get`. First dont forget to check your `flutter_barcode_scanner` package name is correct and the version is exist – Blasanka Dec 20 '19 at 03:33
  • If you are using M1 chip then answer is here https://stackoverflow.com/questions/72751206/error-to-set-up-cocoapods-for-arm-macos-run-arch-x86-64-sudo-gem-install-ffi – Pietrek Sep 21 '22 at 17:37

7 Answers7

17

try this

rm ios/Podfile
flutter pub upgrade
flutter pub run
cd ios
pod init
pod update
flutter clean && flutter run
Mehtab
  • 453
  • 5
  • 17
4

Flutter: Try this

  1. Delete the Podfile, Podfile.lock, Pods folder, Runner.xcworkspace, Flutter.framwork(in ios/Flutter folder)
  2. flutter clean
  3. flutter build ios
Deepak Ror
  • 2,084
  • 2
  • 20
  • 26
3

For the m1 Mac I had a similar error for google mobile ads. The solution was that you have to download cocoa-pods from homebrew. Follow The 2022 update: https://stackoverflow.com/a/65334677/16122154

Vraj Shah
  • 536
  • 2
  • 7
  • 19
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 12 '22 at 21:29
1

The following works for me:

sudo arch -x86_64 gem install ffi 
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
0

Trust me, I search for over 5 hours, tried every solution I cound find on internet. And only one work:

  1. Delete the Podfile, Podfile.lock, Pods folder
  2. flutter clean
  3. cd ios
  4. pod deintegrate ( this way pod will not reinstall the old libray )
  5. cd ../
  6. flutter run

Most of the solution don't include step 4, so that why even you clean and reinstall pod, it still behave the same.

Thien Trong
  • 69
  • 3
  • 3
0

If you are using Flutter, in your pubspec.yaml file make sure that your dependencies are installed below the cupertino icons line with correct indentation or it'll throw an error.

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 31 '21 at 07:24
-3

https://gorails.com/setup/osx/10.15-catalina

Make your day happy thanks buddy for the help...

MacOS catalina has permission issues on pre installed ruby and rails.

rbenv is best version control thing. You need to install this tool by using terminal:

Open your terminal and type these commands:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

And then run these commands:

brew install rbenv ruby-build

# Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc
source ~/.zshrc

# Install Ruby
rbenv install 2.7.1
rbenv global 2.7.1
ruby -v
now install pods by going to your ios folder in flutter project
cd ios 
pod install

That's it.

fcdt
  • 2,371
  • 5
  • 14
  • 26
Abid Ali
  • 9
  • 1