'Flutter: CocoaPods could not find compatible versions for pod "FBSDKCoreKit"
I am build a flutter app and in that I developing logging with Facebook in a flutter. i used flutter_facebook_login: ^3.0.0
and flutter_facebook_auth: ^3.3.2
plugins, this plugin works in android but in ios it gives me below error:
[!] CocoaPods could not find compatible versions for pod "FBSDKCoreKit":
In Podfile:
flutter_facebook_auth (from `.symlinks/plugins/flutter_facebook_auth/ios`) was resolved to 2.0.0, which depends on
FBSDKCoreKit (~> 9.1.0)
flutter_facebook_login (from `.symlinks/plugins/flutter_facebook_login/ios`) was resolved to 0.0.1, which depends on
FBSDKCoreKit (~> 5.5)
My flutter doctor -v:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.4, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[!] Xcode - develop for iOS and macOS
! Xcode 12.0.0 out of date (12.0.1 is recommended).
Download the latest version or update via the Mac App Store.
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] Connected device (2 available)
! Doctor found issues in 1 category.
mac@PK-iMac BBT VIIBO % flutter doctor -v)
zsh: parse error near `)'
mac@PK-iMac BBT VIIBO % flutter doctor -v
[✓] Flutter (Channel stable, 2.0.4, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-GB)
• Flutter version 2.0.4 at /Users/mac/Development/flutter
• Framework revision b1395592de (4 weeks ago), 2021-04-01 14:25:01 -0700
• Engine revision 2dce47073a
• Dart version 2.12.2
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/mac/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[!] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.0, Build version 12A7209
! Xcode 12.0.0 out of date (12.0.1 is recommended).
Download the latest version or update via the Mac App Store.
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] Connected device (2 available)
• iPhone 11 Pro (mobile) • 47FC0E06-9F40-4F1E-8230-CC914F734D26 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.93
! Doctor found issues in 1 category.
Already run pod repo update
but can't solve
So what should I do now?
Solution 1:[1]
To fix this issue follow below steps:
flutter clean
- Run
rm -f ios/Podfile.lock
(For removeios/Podfile.lock
file) cd ios
and hitpod update
(Updates all the dependencies)flutter run
Solution 2:[2]
if you have intel chip
- flutter clean
- update all dependencies to the latest version in pubspec.yml file and do 'get pub'
- Go to your Podfile and uncomment #platform :ios, '9.0' Then change the version to 10 platform :ios, '10.0' or higher version
- go to ios folder through terminal and do 'pod repo update'
- 'pod update' or 'pod install'
if you have M1 chip
- flutter clean
- update all dependencies to the latest version in pubspec.yml file and do 'get pub'
- Go to your Podfile and uncomment #platform :ios, '9.0' Then change the version to 10 platform :ios, '10.0' or higher version
- go to ios folder through terminal and do 'arch -x86_64 pod repo update'
- 'arch -x86_64 pod update' or 'arch -x86_64 pod install'
Solution 3:[3]
If you're using Macbook with M1(apple silicon), you can try:
arch -x86_64 pod install --repo-update
Solution 4:[4]
You can try this,
First Flutter clean then, From ios folder delete .symlinks, Pods, Podfile.lock and Runner.xcworkspace.
then run pub get.
tell me if it works or not.
Solution 5:[5]
try this
flutter clean
you can delete podfile.lock manually or by using this command in terminal
rm -f ios/Podfile.lock
run
flutter pub get
otherwise you will get this error
Invalid `Podfile` file: /Users/<YOUR HOME DIRECTORY>/Documents/----/-----/------/---/ios/Flutter/Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first.
- navigate to the
/ios
folder viacd/ios
in your root directory of your project thenpod update
5.flutter run
P.S. make sure that your podfile has the correct minimum iOS deployment target ,check that every pod can handle the required iOS version.
Solution 6:[6]
This worked (Mac intel machine)
I changed target to 12.0
# Uncomment this line to define a global platform for your project
platform :ios, '12.0'
Then type pod install
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Paresh Mangukiya |
Solution 2 | Tushar Moradiya |
Solution 3 | Adem Ekici |
Solution 4 | Rajni Gujarati |
Solution 5 | Amir_P |
Solution 6 | Quick learner |