I have repeatedly failing to build the app in Flutter for iOS. then tried with a fresh new app with just a simple line of dependency and now it is completely not possible to build.
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
cloud_firestore: ^0.12.11`
Here is the output of the error reported in Android Studio
Waiting for another flutter command to release the startup lock...
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running pod install...
Running Xcode build...
Xcode build done. 258.6s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/mamun/development/projects/flutter_app_testtwo/ios/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Write.pbobjc.m:33:10: warning: non-portable path to file '<protobuf/Timestamp.pbobjc.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#import <Protobuf/Timestamp.pbobjc.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<protobuf/Timestamp.pbobjc.h>
1 warning generated.
/Users/mamun/development/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:155:24: error: no visible @interface for 'FIRQuery' declares the selector 'queryWhereField:arrayContainsAny:'
query = [query queryWhereField:fieldName arrayContainsAny:value];
~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/mamun/development/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:157:24: error: no visible @interface for 'FIRQuery' declares the selector 'queryWhereFieldPath:arrayContainsAny:'
query = [query queryWhereFieldPath:fieldPath arrayContainsAny:value];
~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/mamun/development/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:163:24: error: no visible @interface for 'FIRQuery' declares the selector 'queryWhereField:in:'
query = [query queryWhereField:fieldName in:value];
~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/mamun/development/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:165:24: error: no visible @interface for 'FIRQuery' declares the selector 'queryWhereFieldPath:in:'
query = [query queryWhereFieldPath:fieldPath in:value];
~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/mamun/development/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:764:16: warning: 'timestampsInSnapshotsEnabled' is deprecated [-Wdeprecated-declarations]
settings.timestampsInSnapshotsEnabled = (bool)call.arguments[@"timestampsInSnapshotsEnabled"];
^
In module 'FirebaseFirestore' imported from /Users/mamun/development/projects/flutter_app_testtwo/ios/Pods/Headers/Public/Firebase/Firebase.h:45:
/Users/mamun/development/projects/flutter_app_testtwo/ios/Pods/FirebaseFirestore/Firestore/Source/Public/FIRFirestoreSettings.h:69:20: note: 'timestampsInSnapshotsEnabled' has been explicitly marked deprecated here
__attribute__((deprecated));
^
1 warning and 4 errors generated.
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.
Hi @mamunur34
can you please provide your updated flutter doctor -v
and your flutter build --verbose?
Also, to better address the issue, would be helpful
if you could post a minimal code sample
or the steps to reproduce the problem.
Thank you
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/subs/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.1, Build version 11A1027
• CocoaPods version 1.7.5
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 42.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.40.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.7.0
[✓] Connected device (1 available)
• iPhone 11 Pro Max • 40176A5D-8B4C-4954-9FFF-BB0F09CA1520 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-1 (simulator)
Encountered error while building for device.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1 BuildIOSCommand.runCommand (package:flutter_tools/src/commands/build_ios.dart:94:7)
<asynchronous suspension>
#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:490:18)
#3 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#4 _rootRunUnary (dart:async/zone.dart:1132:38)
#5 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#6 _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#7 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#8 Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#9 Future._completeWithValue (dart:async/future_impl.dart:522:5)
#10 Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:552:7)
#11 _rootRun (dart:async/zone.dart:1124:13)
#12 _CustomZone.run (dart:async/zone.dart:1021:19)
#13 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#14 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#15 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#16 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#17 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#18 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)
cd ios and run pod update Firebase/Firestore and run build command
let me know
cd ios and run
pod update Firebase/Firestoreand run build commandlet me know
I had same issue, this command fixed it. I think latest cloud_firestore package has some versioning issues.
cd ios and run
pod update Firebase/Firestoreand run build commandlet me know
it doesn't fix the error. this is happening for all flutter fire plugins. have been facing this problem for the past 4 days. really need help. Apps were working fine a week ago
The app is stuck here as show below after running the above commands
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running pod install... 11.4s
Running Xcode build...
├─Assembling Flutter resources... 9.4s
└─Compiling, linking and signing... 12.7s
Xcode build done. 155.0s
path: satisfied (Path is satisfied), interface: en0
Configuring the default Firebase app...
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23c4f02e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff50b97b20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23c4ee6c +[NSException raise:format:] + 188
3 Runner 0x00000001026e251a +[FIRApp configure] + 138
4 Runner 0x0000000102bf6ba6 -[FLTCloudFirestorePlugin init] + 214
5 Runner 0x0000000102bf69a4 +[FLTCloudFirestorePlugin registerWithRegistrar:] + 292
6 Runner 0x00000001026ddd60 +[GeneratedPluginRegistrant registerWithRegistry:] + 112
7 Runner <…>
I've got the same problem, but got it working by going to the ios directory and asking an update of the pods related to firebase/firestore:
cd ios
pod update Firebase/Firestore
cd ios and run
pod update Firebase/Firestoreand run build commandlet me know
sorry, just saw now your answer
I solved. Start to run for iOS after following command.
cd ios
pod update Firebase/Firestore
rm -rf Pods
Hi @mamunur34
does the solution proposed by @hukusuke1007 solves you issue?
thank you
cd ios
pod update Firebase/Firestore
this solved my problem
Thanks. pod update Firebase/Firestore solved this problem for me
cd ios
pod update Firebase/Firestore
rm -rf Pods
Thanks it's wprkis for me
This fixed the issue for me! I didn't have to remove the ios/Pods. I just ran pod update Firebase/Firestore
cd ios
pod update Firebase/*
rm -rf Pods
Seems to be a catch-all fix, the asterisk will also update any other firebase
libraries that may be causing an issue
First off, I tried 'flutter clean' & 'flutter run' but that didn't help. Tried 'flutter pub get', after that I tried to run the app again, which failed. Same after doing 'flutter upgrade'. So I wasn't able to build the iOS version of my app as well, the following steps fixed it for me:
My steps are not super clear. I, like any other developer, was just trial and erroring to fix the issue. The above steps helped me getting my app to run again on iOS. Hope it might help anyone else.
I believe the steps suggested by the other people here helped me too with OP's error, however at some point my error messaging came from the pod updater and it was something about my google_maps dependency (https://pub.dev/packages/google_maps_flutter). The 'pod update' simply fixed that too.
Hey, as part of our on-going work for #2582, this has been resolved in our Firebase Firestore rework (#2913) (cloud_firestore podspec now explicitly sets a version of the Firebase iOS SDK that it depends on) - which has now been merged into master. We'll look at publishing some prereleases in the next few days. Thank you
Most helpful comment
cd ios and run
pod update Firebase/Firestoreand run build commandlet me know