Error running Flutter app on iOS after upgrading dependencies in pub.dev. (M1 mac)
The app runs smoothly on android devices.
Debug console:
Launching lib/main.dart on iPhone 15 Pro Max in debug mode...
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Using `ARCHS` setting to build architectures of target `Pods-RunnerTests`: (``)
Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
cloud_firestore: Using Firebase SDK version '10.20.0' defined in 'firebase_core'
-> Fetching podspec for `connectivity_plus` from `.symlinks/plugins/connectivity_plus/ios`
-> Fetching podspec for `firebase_analytics` from `.symlinks/plugins/firebase_analytics/ios`
firebase_analytics: Using Firebase SDK version '10.20.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
firebase_auth: Using Firebase SDK version '10.20.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
firebase_core: Using Firebase SDK version '10.20.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_database` from `.symlinks/plugins/firebase_database/ios`
firebase_database: Using Firebase SDK version '10.20.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_in_app_messaging` from `.symlinks/plugins/firebase_in_app_messaging/ios`
firebase_in_app_messaging: Using Firebase SDK version '10.20.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_messaging` from `.symlinks/plugins/firebase_messaging/ios`
.
.
.
Resolving dependencies of `Podfile`
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
.
.
.
performed in repo update
[!] CocoaPods could not find compatible versions for pod "Firebase/InAppMessaging":
In Podfile:
firebase_in_app_messaging (from `.symlinks/plugins/firebase_in_app_messaging/ios`) was resolved to 0.7.4-12, which depends on
Firebase/InAppMessaging (= 10.20.0)
None of your spec sources contain a spec satisfying the dependency: `Firebase/InAppMessaging (= 10.20.0)`.
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
/opt/homebrew/Cellar/cocoapods/1.15.0/libexec/gems/molinillo-.
.
.
.
Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.
To update the CocoaPods specs, run:
pod repo update
Error running pod install
Error launching application on iPhone 15 Pro Max.
Exited (1).
Tried everything from deleting pods to cleaning pub cache, but the issue is still here.
hamza@Hamzas-macbook ios % arch -x86_64 pod install --repo-update --allow-root
Updating local specs repositories
Analyzing dependencies
cloud_firestore: Using Firebase SDK version '10.20.0' defined in 'firebase_core'
firebase_analytics: Using Firebase SDK version '10.20.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '10.20.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '10.20.0' defined in 'firebase_core'
firebase_database: Using Firebase SDK version '10.20.0' defined in 'firebase_core'
firebase_in_app_messaging: Using Firebase SDK version '10.20.0' defined in 'firebase_core'
firebase_messaging: Using Firebase SDK version '10.20.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "Firebase/InAppMessaging":
In Podfile:
firebase_in_app_messaging (from `.symlinks/plugins/firebase_in_app_messaging/ios`) was resolved to 0.7.4-12, which depends on
Firebase/InAppMessaging (= 10.20.0)
None of your spec sources contain a spec satisfying the dependency: `Firebase/InAppMessaging (= 10.20.0)`.
You have either:
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
Commands I have already tried (after deleting pods):
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
arch -x86_64 pod install –repo-update
flutter pub get
cd ios
arch -x86_64 pod install –repo-update
arch -x86_64 pod install
Dependencies:
firebase_auth: ^4.15.3
firebase_core: ^2.24.2
cloud_firestore: ^4.14.0
firebase_database: ^10.4.0
firebase_messaging: ^14.7.10
firebase_analytics: ^10.8.0
firebase_in_app_messaging: ^0.7.4+12
hamza@Hamzas-macbook ios % flutter pub upgrade
Resolving dependencies in ..... (15.0s)
ffi 2.1.0 (2.1.2 available)
> file 7.0.0 (was 6.1.4)
js 0.6.7 (0.7.0 available)
matcher 0.12.16 (0.12.16+1 available)
material_color_utilities 0.5.0 (0.8.0 available)
meta 1.10.0 (1.11.0 available)
path 1.8.3 (1.9.0 available)
test_api 0.6.1 (0.7.0 available)
web 0.3.0 (0.4.2 available)
Changed 1 dependency in ..!
8 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
hamza@Hamzas-macbook ios % flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.7, on macOS 14.2.1 23C71 darwin-arm64,
locale en-PK)
[✓] Android toolchain - develop for Android devices (Android SDK version
34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.86.0)
[✓] Connected device (4 available)
[✓] Network resources
• No issues found!
hamza@Hamzas-macbook
Pod file
platform :ios, '12.0'
.
.
.
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end
.
.
.
2
Answers
After trying everything finally I found the solution.
Update Flutter
Update Cocoapods
Update Xcode
Flutter clean
pod deintegrate
Flutter pub get
arch -x86_64 pod install
Flutter run
basically, you have to update everything to the latest version to the latest version to resolve the compatibility issue.
Delete podfile.lock first and in terminal try this commands.
It will solve your problem.