Flutter: unable to run application on iOS emulator - firebase

The code worked fine. As the firebase packages got updated in the pub.dev website, I changed the firebase instances to the new version. After that, I guess the firebase package didn't install properly and threw this error when I ran flutter run for the iOS emulator.
rishikrishna#Rishikrishnas-MacBook-Pro chat_server % flutter run
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running pod install... 0.9s
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Finding Podfile changes
A firebase_storage
- Flutter
- cloud_firestore
- firebase_auth
- firebase_core
- image_picker
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 '6.26.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
firebase_auth: Using Firebase SDK version '6.26.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
firebase_core: Using Firebase SDK version '6.26.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_storage` from `.symlinks/plugins/firebase_storage/ios`
firebase_storage: Using Firebase SDK version '6.26.0' defined in 'firebase_core'
-> Fetching podspec for `image_picker` from `.symlinks/plugins/image_picker/ios`
Resolving dependencies of `Podfile`
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_0_3_5.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/3/5/Firebase/6.20.0/Firebase.podspec.json exists! Returning local because checking is only
performed in repo update
CDN: trunk Relative path: Specs/0/3/5/Firebase/6.20.0/Firebase.podspec.json exists! Returning local because checking is only
performed in repo update
[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
In snapshot (Podfile.lock):
Firebase/CoreOnly (= 6.20.0)
In Podfile:
cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.14.0-2, which depends on
Firebase/CoreOnly (~> 6.26.0)
Specs satisfying the `Firebase/CoreOnly (= 6.20.0), Firebase/CoreOnly (~> 6.26.0)` dependency were found, but they required a higher
minimum deployment target.
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:257:in `process_topmost_state'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/resolver.rb:94:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:986:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:984:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:410:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:234:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:233:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:156:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/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.8.4/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
Error running pod install
Error launching application on iPhone 11 Pro Max.
Flutter doctor:
rishikrishna#Rishikrishnas-MacBook-Pro chat_server % flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.20.3, on Mac OS X 10.15.6 19G2021, locale en-IN)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
✗ Android license status unknown.
Try reinstalling or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit https://flutter.dev/docs/get-started/install/macos#android-setup for
detailed instructions.
[✓] Xcode - develop for iOS and macOS (Xcode 12.0)
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.49.1)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
Also, I reinstalled all packages and tried flutter clean.
Open for ideas.

Open the Runner.xcworkspace in Xcode then clean and build the project and try to re-run.
This works for me. I was facing the same issue.

Related

cannot run the flutter app after firebase connection

After i added the GoogleService-Info.plist file to Runner on xcode, I get this error.
(I work on an M1 Chip MacBook Air)
I uninstalled each cocoapods version, and installed again using the ARM version (sudo arch -x86_64 gem install cocoapods).
But nothing changed.
Edit: Just tried the pod install method inside the ios folder and this is what happened;
Analyzing dependencies
cloud_firestore: Using Firebase SDK version '8.11.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '8.11.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '8.11.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "cloud_firestore":
In Podfile:
cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)
Specs satisfying the `cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)` dependency were found, but they required a higher minimum deployment target.
[!] Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
you need first to upgrade your package by write "pub upgrade" command
after it try to update podfile as below setups :
inside terminal move to ios folder "cd ios"
enter "pod update" command
if above point not working try "pod install" command
Final edit: I solved it thanks to this issue. The problem was that there's no Podfile.lock in the /ios folder.

I can't debug my code in VSCODE because of this error

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
lib/main.dart:1
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
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 '8.6.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
firebase_auth: Using Firebase SDK version '8.6.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
firebase_core: Using Firebase SDK version '8.6.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_storage` from `.symlinks/plugins/firebase_storage/ios`
firebase_storage: Using Firebase SDK version '8.6.0' defined in 'firebase_core'
Resolving dependencies of `Podfile`
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
[!] CocoaPods could not find compatible versions for pod "cloud_firestore":
In Podfile:
cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)
Specs satisfying the `cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)` dependency were found, but they required a higher minimum deployment target.
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:317:in `raise_error_unless_state'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:299:in `block in unwind_for_conflict'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `tap'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `unwind_for_conflict'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:682:in `attempt_to_activate'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/resolver.rb:94:in `resolve'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1078:in `block in resolve_dependencies'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:416:in `analyze'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:161:in `install!'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:52:in `run'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
/usr/local/Cellar/cocoapods/1.11.2/libexec/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
/usr/local/Cellar/cocoapods/1.11.2/libexec/bin/pod:23:in `load'
/usr/local/Cellar/cocoapods/1.11.2/libexec/bin/pod:23:in `<main>'
Error output from CocoaPods:
↳
[!] Automatically assigning platform iOS with version 9.0 on target Runner because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.
Error running pod install
Error launching application on iPhone 12 Pro Max.

Missing compatible version from cocopods in flutter /firebase project

just git a big problem with the installed pods on my flutter/firebase project.
Get this message every time after "pod install":
"Analyzing dependencies
cloud_firestore: Using Firebase SDK version '8.0.0' defined in 'firebase_core'
cloud_functions: Using Firebase SDK version '8.0.0' defined in 'firebase_core'
firebase_analytics: Using Firebase SDK version '8.0.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '8.0.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '8.0.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "cloud_firestore":
In Podfile:
cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)
Specs satisfying the `cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)` dependency were found, but they required a higher minimum deployment target."
Im on a Mac M1, but most tricks from stack overflow aso don't help much.
Already installed with "sudo arch -x86_64 gem install ffi" & "arch -x86_64 pod install"
Heres are the dependencies:
flutter:
sdk: flutter
firebase_core: ^1.3.0
firebase_analytics: ^8.1.2
firebase_auth: ^1.4.1
cloud_firestore: ^2.2.0+1
cloud_functions: ^1.1.2
After deleting one, the given message from above appears with a new pod.
I really don't know what to do after hours...
thanks!
You can try this way,
First Flutter clean then, From ios folder delete .symlinks, Pods, Podfile.lock and Runner.xcworkspace.
then run pub get.
Hope it will work for you.

Flutter - No compatible iOS versions between Flutterfire and Geofire (pods)

I'm trying to get all my dependencies updated for null safety and the following scenario when I run pod install:
Analyzing dependencies
cloud_firestore: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
cloud_functions: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_analytics: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_database: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_messaging: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_storage: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "Firebase/Database":
In Podfile:
firebase_database (from `.symlinks/plugins/firebase_database/ios`) was resolved to 6.1.2, which depends on
Firebase/Database (= 7.3.0)
flutter_geofire (from `.symlinks/plugins/flutter_geofire/ios`) was resolved to 0.0.1, which depends on
GeoFire (~> 4.2) was resolved to 4.2.0, which depends on
GeoFire/Database (= 4.2.0) was resolved to 4.2.0, which depends on
Firebase/Database (~> 7.8.0)
Checking the native ios geofire and flutterfire library, I realize that the current version from geofire for iOS aims firebase database ~> 7.8 and the previously one database ~> 6.x.x.
Flutterfire null safety aims firebase 7.3.
Turning actually impossible to find a version with null-safety compatible between flutterfire and geofire.
I have tried before completely remove my pods with the commands without success:
cd ios
rm -rf Pods
rm -rf Podfile.lock
rm -rf ~/.pub-cache/hosted/pub.dartlang.org/
pod cache clean --all
pod deintegrate
flutter clean
flutter pub get
pod repo update
pod install
Any suggestions? thank you!

why flutter has stopped to launch my app on ios

All of a sudden I cant run my flutter app that uses firebase.
Apparently there's a problem with the pod install process, some dependency incompatibility.
Given the fact that I haven't changed anything in the yaml file and the app worked perfectly this morning, I assume is some problem with the tools and not with my source code.
The problem appeared after a flutter plugin update, but I don't know if the two things are related.
This is the build output:
Launching lib/main.dart on iPhone XR in debug mode...
Running pod install...
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Fetching external sources
-> Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
-> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
-> Fetching podspec for `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
-> Fetching podspec for `google_sign_in` from `.symlinks/plugins/google_sign_in/ios`
Resolving dependencies of `Podfile`
[!] CocoaPods could not find compatible versions for pod "Firebase/Auth":
In Podfile:
cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
Firebase/Auth
firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) was resolved to 0.0.1, which depends on
Firebase/Auth (~> 5.19)
Specs satisfying the `Firebase/Auth, Firebase/Auth (~> 5.19)` 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:257: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.6.1/lib/cocoapods/resolver.rb:91:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer/analyzer.rb:909:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer/analyzer.rb:907:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer/analyzer.rb:114:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:266:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:174:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:173:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:136:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/command/install.rb:48:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'
Error output from CocoaPods:
↳
[!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Error running pod install
Error launching application on iPhone XR.

Resources