My Firebase Crashlytics log some crashes only on iOS.
I have no idea when the error occurs and why.
Crash log:
Crashed: io.flutter.1.io
0 FirebaseCrashlytics 0x1bf34 FIRCLSProcessRecordAllThreads + 180
1 FirebaseCrashlytics 0x1c318 FIRCLSProcessRecordAllThreads + 1176
2 FirebaseCrashlytics 0x150c0 FIRCLSHandler + 48
3 FirebaseCrashlytics 0xf2f4 __FIRCLSExceptionRecord_block_invoke + 92
4 libdispatch.dylib 0x4660 _dispatch_client_callout + 20
5 libdispatch.dylib 0x138b4 _dispatch_lane_barrier_sync_invoke_and_complete + 56
6 FirebaseCrashlytics 0xea6c FIRCLSExceptionRecord + 212
7 FirebaseCrashlytics 0xe700 FIRCLSTerminateHandler() + 592
8 libc++abi.dylib 0x12f58 std::__terminate(void (*)()) + 20
9 libc++abi.dylib 0x15efc __cxa_rethrow + 148
10 libobjc.A.dylib 0x17e8c objc_exception_rethrow + 44
11 CoreFoundation 0x1f4a4 CFRunLoopRunSpecific + 836
12 Flutter 0x2f0f74 (Missing)
13 Flutter 0x2f0788 (Missing)
14 libsystem_pthread.dylib 0x19a4 _pthread_start + 148
15 libsystem_pthread.dylib 0xea0 thread_start + 8
It look like crash in background when I show "Device states" tab, right?
Flutter verrsion:
Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 18116933e7 (9 weeks ago) • 2021-10-15 10:46:35 -0700
Engine • revision d3ea636dc5
Tools • Dart 2.14.4
flutter doctor -v:
[✓] Flutter (Channel stable, 2.5.3, on Mac OS X 10.15.7 19H524 darwin-x64, locale en-VN)
• Flutter version 2.5.3 at /Users/TuanHwing/Desktop/Development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18116933e7 (9 weeks ago), 2021-10-15 10:46:35 -0700
• Engine revision d3ea636dc5
• Dart version 2.14.4
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/TuanHwing/Library/Android/sdk
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• 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 11.0.10+0-b96-7281165)
[✓] Connected device (2 available)
• iPhone’s Tuấn (mobile) • f7f710fd822ab731ca493fa4f6293bdd4e1910bd • ios • iOS 13.4.1 17E262
• Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.93
! Doctor found issues in 1 category.
Does anyone know how to resolve the problem?
Related
Ok. I'm throwing in the towel cause I can't seem to solve this problem. Initially I didn't have cocoapods installed correctly. I followed some steps to uninstall it and then run 'sudo gem install cocoapods'. Now if I type 'which pod' I get a response '/usr/local/bin/pod. If I run flutter doctor it reports everything is ok:
> [exec] [✓] Flutter (Channel stable, 2.2.3, on macOS 11.2.1 20D75
> darwin-x64, locale en-US)
> [exec] • Flutter version 2.2.3 at /usr/local/lib/flutter
> [exec] • Framework revision f4abaa0735 (6 weeks ago), 2021-07-01 12:46:11 -0700
> [exec] • Engine revision 241c87ad80
> [exec] • Dart version 2.13.4
> [exec]
> [exec] [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
> [exec] • Android SDK at /Users/rms_licenses/Library/Android/sdk
> [exec] • Platform android-30, build-tools 29.0.2
> [exec] • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
> [exec] • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
> [exec] • All Android licenses accepted.
> [exec]
> [exec] [!] Xcode - develop for iOS and macOS
> [exec] • Xcode at /Applications/Xcode.app/Contents/Developer
> [exec] • Xcode 12.5.1, Build version 12E507
> [exec] * CocoaPods version 1.10.2
> [exec]
> [exec] [✓] Chrome - develop for the web
> [exec] • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
> [exec]
> [exec] [✓] Android Studio (version 3.0)
> [exec] • Android Studio at /Applications/Android Studio.app/Contents
> [exec] • Flutter plugin can be installed from:
> [exec] 🔨 https://plugins.jetbrains.com/plugin/9212-flutter
> [exec] • Dart plugin can be installed from:
> [exec] 🔨 https://plugins.jetbrains.com/plugin/6351-dart
> [exec] • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
> [exec]
> [exec] [✓] Connected device (2 available)
> [exec] • macOS (desktop) • macos • darwin-x64 • macOS 11.2.1 20D75 darwin-x64
> [exec] • Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.212
However if I run flutter doctor through my Jenkins job:
[exec] [✓] Flutter (Channel stable, 2.2.3, on macOS 11.2.1 20D75 darwin-x64, locale en-US)
[exec] • Flutter version 2.2.3 at /usr/local/lib/flutter
[exec] • Framework revision f4abaa0735 (6 weeks ago), 2021-07-01 12:46:11 -0700
[exec] • Engine revision 241c87ad80
[exec] • Dart version 2.13.4
[exec]
[exec] [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[exec] • Android SDK at /Users/rms_licenses/Library/Android/sdk
[exec] • Platform android-30, build-tools 29.0.2
[exec] • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
[exec] • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
[exec] • All Android licenses accepted.
[exec]
[exec] [!] Xcode - develop for iOS and macOS
[exec] • Xcode at /Applications/Xcode.app/Contents/Developer
[exec] • Xcode 12.5.1, Build version 12E507
[exec] ✗ CocoaPods not installed.
[exec] CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
[exec] Without CocoaPods, plugins will not work on iOS or macOS.
[exec] For more info, see https://flutter.dev/platform-plugins
[exec] To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[exec]
[exec] [✓] Chrome - develop for the web
[exec] • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[exec]
[exec] [✓] Android Studio (version 3.0)
[exec] • Android Studio at /Applications/Android Studio.app/Contents
[exec] • Flutter plugin can be installed from:
[exec] 🔨 https://plugins.jetbrains.com/plugin/9212-flutter
[exec] • Dart plugin can be installed from:
[exec] 🔨 https://plugins.jetbrains.com/plugin/6351-dart
[exec] • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
[exec]
[exec] [✓] Connected device (2 available)
[exec] • macOS (desktop) • macos • darwin-x64 • macOS 11.2.1 20D75 darwin-x64
[exec] • Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.212
We can build the ios app just fine through the terminal (& manually through xcode) but I'm stuck on this cocoapods thing. I suspect maybe its a permission thing but not sure. I've updated Flutter, xcode. When building through the terminal I see a command called "Which pod" but I doesn't seem to work when going through Jenkins. Instead it says this:
> [exec] [ +4 ms] Warning: CocoaPods not installed. Skipping pod install.
> [exec] CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage
> on the Dart side.
> [exec] Without CocoaPods, plugins will not work on iOS or macOS.
> [exec] For more info, see https://flutter.dev/platform-plugins
> [exec] To install see https://guides.cocoapods.org/using/getting-started.html#installation
> for instructions.
Any ideas on why it won't work through Jenkins but fine through the terminal?
Thx for any help you might give.
~jeff
Edit:
I changed the permissions on the flutter directory and it now says:
> [exec] [ ] Found plugin video_player at
> /usr/local/lib/flutter/.pub-cache/hosted/pub.dartlang.org/video_player-2.1.1/
> CocoaPods is used to retrieve the iOS and macOS platform side's plugin
> code that responds to your plugin usage on the Dart side.
> [exec]
> [exec] [ ] Found plugin video_player_web at /usr/local/lib/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_web-2.0.0/
> Without CocoaPods, plugins will not work on iOS or macOS.
> [exec]
> [exec] For more info, see https://flutter.dev/platform-plugins
> [exec] To install see https://guides.cocoapods.org/using/getting-started.html#installation
> for instructions.
> [exec]
> [exec] [ ] Found plugin wakelock at /usr/local/lib/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock-0.4.0/[
> +5 ms] CocoaPods not installed or not in valid state.
> [exec]
> [exec] [ ] Found plugin wakelock_macos at /usr/local/lib/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock_macos-0.1.0/[
> ]
> [exec] [ ] Found plugin wakelock_web at /usr/local/lib/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock_web-0.2.0/
> [exec]
> [exec] [ ] Found plugin webview_flutter at /usr/local/lib/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-2.0.8/
> #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
> [exec]
> [exec] [ +11 ms] executing: which pod
> [exec] [ +11 ms] "flutter ios" took 2,936ms.
> [exec] #1 CocoaPods.processPods (package:flutter_tools/src/macos/cocoapods.dart:169:9)
> [exec] <asynchronous suspension>
I had the same problem. In my case, CocoaPods was installed under /usr/local/bin but that wasn't in my $PATH when running a Jenkins build.
Once I added it to my path in Jenkins, it started working.
So, I've done lots of researching across the internet, have tried all the solutions I could think off: flutter clean, pod init, pod install pod update, updating the security rules, and also re-adding the Google Services plist file multiple times through Xcode, editing AppDelegate.swift and adding the proper code, making sure to ensurewidgetbinding and initializing the FirebaseApp in main, updating my firebase packages, but this error still keeps popping up when trying to access Firestore data. Firestore auth works fine though, and although my app doesn't work on a iOS simulator, it works perfectly find on Android simulator.
I've been facing this issue from a number of days.
The key issue is: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'FIRESTORE INTERNAL ASSERTION FAILED: threads > 1'
Here are more details of the stack log:
2021-04-13 13:52:31.821705-0700 Runner[19143:118021] *** Assertion failure in static std::unique_ptr firebase::firestore::util::Executor::CreateConcurrent(const char *, int)(), /(my app path)/ios/Pods/FirebaseFirestore/Firestore/core/src/util/executor_libdispatch.mm:368
2021-04-13 13:52:31.914078-0700 Runner[19143:118021] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'FIRESTORE INTERNAL ASSERTION FAILED: threads > 1'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff20422ff2 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007fff20193ff5 objc_exception_throw + 48
2 CoreFoundation 0x00007fff20422e1b +[NSException raise:format:] + 0
3 Foundation 0x00007fff20774a20 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 166
4 FirebaseFirestore 0x0000000102cb2107 _ZN8firebase9firestore4util16ObjcThrowHandlerENS1_13ExceptionTypeEPKcS4_iRKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 343
5 FirebaseFirestore 0x0000000102cb1665 _ZN8firebase9firestore4util5ThrowENS1_13ExceptionTypeEPKcS4_iRKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 53
6 FirebaseFirestore 0x0000000102e06d7d _ZN8firebase9firestore4util8internal13FailAssertionEPKcS4_iRKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 45
7 FirebaseFirestore 0x0000000102e06e31 ZN8firebase9firestore4util8internal13FailAssertionEPKcS4_iRKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEES4 + 177
8 FirebaseFirestore 0x0000000102cb465e _ZN8firebase9firestore4util8Executor16CreateConcurrentEPKci + 94
9 FirebaseFirestore 0x0000000102e4afe7 _ZN8firebase9firestore5local26LevelDbRemoteDocumentCacheC2EPNS1_18LevelDbPersistenceEPNS1_15LocalSerializerE + 327
10 FirebaseFirestore 0x0000000102e4b165 _ZN8firebase9firestore5local26LevelDbRemoteDocumentCacheC1EPNS1_18LevelDbPersistenceEPNS1_15LocalSerializerE + 37
11 FirebaseFirestore 0x0000000102e44bc7 ZN4absl14lts_2020_02_2511make_uniqueIN8firebase9firestore5local26LevelDbRemoteDocumentCacheEJPNS4_18LevelDbPersistenceEPNS4_15LocalSerializerEEEENS0_15memory_internal16MakeUniqueResultIT_E6scalarEDpOT0 + 103
12 FirebaseFirestore 0x0000000102e44788 _ZN8firebase9firestore5local18LevelDbPersistenceC2ENSt3__110unique_ptrIN7leveldb2DBENS3_14default_deleteIS6_EEEENS0_4util4PathENS3_3setINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS3_4lessISI_EENSG_ISI_EEEENS1_15LocalSerializerERKNS1_9LruParamsE + 536
13 FirebaseFirestore 0x0000000102e4446d _ZN8firebase9firestore5local18LevelDbPersistenceC1ENSt3__110unique_ptrIN7leveldb2DBENS3_14default_deleteIS6_EEEENS0_4util4PathENS3_3setINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS3_4lessISI_EENSG_ISI_EEEENS1_15LocalSerializerERKNS1_9LruParamsE + 29
14 FirebaseFirestore 0x0000000102e439a4 _ZN8firebase9firestore5local18LevelDbPersistence6CreateENS0_4util4PathENS1_15LocalSerializerERKNS1_9LruParamsE + 932
15 FirebaseFirestore 0x0000000102e40260 _ZN8firebase9firestore5local13LevelDbOpener6CreateERKNS1_9LruParamsE + 640
16 FirebaseFirestore 0x0000000102d3715b _ZN8firebase9firestore4core15FirestoreClient10InitializeERKNS0_4auth4UserERKNS0_3api8SettingsE + 379
17 FirebaseFirestore 0x0000000102d4198d _ZZZN8firebase9firestore4core15FirestoreClient6CreateERKNS1_12DatabaseInfoERKNS0_3api8SettingsENSt3__110shared_ptrINS0_4auth19CredentialsProviderEEENSB_INS0_4util8ExecutorEEENSB_INSF_10AsyncQueueEEENSA_10unique_ptrINS0_6remote24FirebaseMetadataProviderENSA_14default_deleteISM_EEEEEN3$_2clENSC_4UserEENKUlvE_clEv + 61
18 FirebaseFirestore 0x0000000102d4192d _ZNSt3__1L8__invokeIRZZN8firebase9firestore4core15FirestoreClient6CreateERKNS3_12DatabaseInfoERKNS2_3api8SettingsENS_10shared_ptrINS2_4auth19CredentialsProviderEEENSC_INS2_4util8ExecutorEEENSC_INSG_10AsyncQueueEEENS_10unique_ptrINS2_6remote24FirebaseMetadataProviderENS_14default_deleteISN_EEEEEN3$2clENSD_4UserEEUlvE_JEEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOSV_DpOSW + 29
19 FirebaseFirestore 0x0000000102d418dd _ZNSt3__128__invoke_void_return_wrapperIvE6__callIJRZZN8firebase9firestore4core15FirestoreClient6CreateERKNS5_12DatabaseInfoERKNS4_3api8SettingsENS_10shared_ptrINS4_4auth19CredentialsProviderEEENSE_INS4_4util8ExecutorEEENSE_INSI_10AsyncQueueEEENS_10unique_ptrINS4_6remote24FirebaseMetadataProviderENS_14default_deleteISP_EEEEEN3$2clENSF_4UserEEUlvE_EEEvDpOT + 29
20 FirebaseFirestore 0x0000000102d418ad _ZNSt3__110__function12__alloc_funcIZZN8firebase9firestore4core15FirestoreClient6CreateERKNS4_12DatabaseInfoERKNS3_3api8SettingsENS_10shared_ptrINS3_4auth19CredentialsProviderEEENSD_INS3_4util8ExecutorEEENSD_INSH_10AsyncQueueEEENS_10unique_ptrINS3_6remote24FirebaseMetadataProviderENS_14default_deleteISO_EEEEEN3$_2clENSE_4UserEEUlvE_NS_9allocatorISU_EEFvvEEclEv + 29
21 FirebaseFirestore 0x0000000102d404de _ZNSt3__110__function6__funcIZZN8firebase9firestore4core15FirestoreClient6CreateERKNS4_12DatabaseInfoERKNS3_3api8SettingsENS_10shared_ptrINS3_4auth19CredentialsProviderEEENSD_INS3_4util8ExecutorEEENSD_INSH_10AsyncQueueEEENS_10unique_ptrINS3_6remote24FirebaseMetadataProviderENS_14default_deleteISO_EEEEEN3$_2clENSE_4UserEEUlvE_NS_9allocatorISU_EEFvvEEclEv + 30
22 FirebaseFirestore 0x0000000102c1b685 _ZNKSt3__110__function12__value_funcIFvvEEclEv + 53
23 FirebaseFirestore 0x0000000102c18c75 _ZNKSt3__18functionIFvvEEclEv + 21
24 FirebaseFirestore 0x0000000102c18bda _ZN8firebase9firestore4util10AsyncQueue15ExecuteBlockingERKNSt3__18functionIFvvEEE + 186
25 FirebaseFirestore 0x0000000102c1da71 _ZZN8firebase9firestore4util10AsyncQueue4WrapERKNSt3__18functionIFvvEEEENK3$_0clEv + 33
26 FirebaseFirestore 0x0000000102c1da2d _ZNSt3__1L8__invokeIRZN8firebase9firestore4util10AsyncQueue4WrapERKNS_8functionIFvvEEEE3$0JEEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOSC_DpOSD + 29
27 FirebaseFirestore 0x0000000102c1d9dd _ZNSt3__128__invoke_void_return_wrapperIvE6__callIJRZN8firebase9firestore4util10AsyncQueue4WrapERKNS_8functionIFvvEEEE3$0EEEvDpOT + 29
28 FirebaseFirestore 0x0000000102c1d9ad _ZNSt3__110__function12__alloc_funcIZN8firebase9firestore4util10AsyncQueue4WrapERKNS_8functionIFvvEEEE3$_0NS_9allocatorISB_EES7_EclEv + 29
29 FirebaseFirestore 0x0000000102c1c72e _ZNSt3__110__function6__funcIZN8firebase9firestore4util10AsyncQueue4WrapERKNS_8functionIFvvEEEE3$_0NS_9allocatorISB_EES7_EclEv + 30
30 FirebaseFirestore 0x0000000102c1b685 _ZNKSt3__110__function12__value_funcIFvvEEclEv + 53
31 FirebaseFirestore 0x0000000102c18c75 _ZNKSt3__18functionIFvvEEclEv + 21
32 FirebaseFirestore 0x000000010303ed15 _ZN8firebase9firestore4util4Task17ExecuteAndReleaseEv + 229
33 FirebaseFirestore 0x0000000102cb308d _ZN8firebase9firestore4util19ExecutorLibdispatch11InvokeAsyncEPv + 29
34 libdispatch.dylib 0x000000010952374e _dispatch_client_callout + 8
35 libdispatch.dylib 0x0000000109529f9a _dispatch_lane_serial_drain + 796
36 libdispatch.dylib 0x000000010952ac67 _dispatch_lane_invoke + 436
37 libdispatch.dylib 0x0000000109536a7a _dispatch_workloop_worker_thread + 872
38 libsystem_pthread.dylib 0x00007fff60250499 _pthread_wqthread + 314
39 libsystem_pthread.dylib 0x00007fff6024f467 start_wqthread + 15
)
libc++abi: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'FIRESTORE INTERNAL ASSERTION FAILED: threads > 1'
terminating with uncaught exception of type NSException
CoreSimulator 757.3 - Device: iPhone 12 (B161D373-CDF3-4E02-A510-A7B855E99FBD) - Runtime: iOS 14.5 (18E5164d) - DeviceType: iPhone 12
(lldb)
Here is my flutter doctor -v results as well if needed:
[✓] Flutter (Channel stable, 2.0.5-0.0.pre.1, on macOS 11.2.3 20D91 darwin-x64,
locale en-US)
• Flutter version 2.0.5-0.0.pre.1 at /Users/hassanwarsi/Desktop/flutter
• Framework revision c63b72218f (6 days ago), 2021-04-07 22:46:48 -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/hassanwarsi/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-beta.app/Contents/Developer
• Xcode 12.5, Build version 12E5244e
• CocoaPods version 1.10.1
[✗] Chrome - develop for the web (Cannot find Chrome executable at
/Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] 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)
[✓] VS Code (version 1.55.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.21.0
[✓] Connected device (1 available)
• iPhone 12 (mobile) • B161D373-CDF3-4E02-A510-A7B855E99FBD • ios •
com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator) ! Doctor found issues in 1 category.
Edit
Here is the code sample I try to run -
import 'dart:async';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:gig/services/database.dart';
import 'package:provider/provider.dart';
import 'models/user.dart';
import 'screens/wrapper.dart';
Future<void> main() async{
WidgetsFlutterBinding.ensureInitialized();
final FirebaseApp app = await Firebase.initializeApp();
assert(app != null);
print('Initialized default app $app');
runApp(MyApp());}
class MyApp extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MultiProvider(providers:[
StreamProvider<User>.value(
value: FirebaseAuth.instance.authStateChanges(),
initialData: FirebaseAuth.instance.currentUser
),
StreamProvider<UserData>(
create: (context) => DatabaseService(uid:"${FirebaseAuth.instance.currentUser}").userData,
// initialData: FirebaseAuth.instance.currentUser
)]
, child:
MaterialApp(
home: Wrapper()
));
}
} ```
Wrapper class -
class Wrapper extends StatefulWidget {
#override
_WrapperState createState() => _WrapperState();
}
class _WrapperState extends State<Wrapper> {
#override
Widget build(BuildContext context) {
while(Provider.of<User>(context)==null){return Loading();}
print("user: ${Provider.of<User>(context)}");
while( Provider.of<UserData>(context)==null){
return Loading();
}
final user = Provider.of<User>(context);
final userd = Provider.of<UserData>(context);
return Container(child:Text("${userd.fname}"));
}
}
I'm compiling a flutter app for android and iOS. The project compiles and runs on android emulators but I get a build error when I try to build the iOS version via VSCode or Android Studio.
Here is the build error:
error: Multiple commands produce
'/Users/jdoe/Development/My-Great-App/my_great_app/build/ios/Debug-development-iphonesimulator/Runner.app/Runner':
1) Target 'Runner' has copy command from '/Users/jdoe/Development/My-Great-App/my_great_app/ios/Runner' to
'/Users/jdoe/Development/My-Great-App/my_great_app/build/ios/Debug-development-iphonesimulator/Runner.app/Runner'
2) Target 'Runner' has link command with output
'/Users/jdoe/Development/My-Great-App/my_great_app/build/ios/Debug-development-iphonesimulator/Runner.app/Runner'
[ +49 ms] Could not build the application for the simulator.
[ +3 ms] Error launching application on iPhone 8.
[ +5 ms] "flutter run" took 79,020ms.
[ +18 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:14:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:607:7)
<asynchronous suspension>
#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:972:18)
#3 _rootRunUnary (dart:async/zone.dart:1198:47)
#4 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#5 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#6 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#7 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#8 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#9 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#10 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#11 RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
#12 _rootRunUnary (dart:async/zone.dart:1198:47)
#13 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#14 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#15 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#16 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#17 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#18 Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:567:7)
#19 _rootRun (dart:async/zone.dart:1190:13)
#20 _CustomZone.run (dart:async/zone.dart:1093:19)
#21 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#22 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#23 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#24 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#25 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#26 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)
Here is my environment:
jdoe#MacBook-Air My Great App % flutter doctor -v
[✓] Flutter (Channel beta, 1.22.0-12.1.pre, on Mac OS X 10.15.6 19G2021, locale en-CA)
• Flutter version 1.22.0-12.1.pre at /Users/toddherron1a/Development/flutter
• Framework revision 8b3760638a (12 days ago), 2020-09-15 17:47:13 -0700
• Engine revision 4654fc6cf6
• Dart version 2.10.0 (build 2.10.0-110.3.beta)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/toddherron1a/Library/Android/sdk
• 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_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.0, Build version 12A7209
• CocoaPods version 1.10.0.rc.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 49.0.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.49.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.14.1
[✓] Connected device (4 available)
• AOSP on IA Emulator (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• iPhone 8 (mobile) • 6F348FD9-AA18-4290-84EA-FB7A1AFB9F9E • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)
• Web Server (web) • web-server • web-javascript • Flutter Tools
• Chrome (web) • chrome • web-javascript • Google Chrome 85.0.4183.121
• No issues found!
Things I've tried:
flutter clean
pod update
Removing VALID_ARCH from Xcode
There is no facebook login in this app, so this solution wasn't applicable.
I'm a bit stuck and I'm continuing development on Android for the time being. Any thoughts or ideas for getting the iOS build to work would be most appreciated!
The problem turned out to be duplicate GoogleService-Info.plist files in Xcode's Copy Bundle Resources (Targets • Runner • Build Phases).
Once both copies were removed using the "-", the build worked.
The thing is that I try to build a iOS release for a flutter app but it crashes I search for results about the errors but found nothing hope someone could help.
NOTE : The app launch and works perfectly on both IOS and Android but doesn't build on any of them. here is my post about the Android problem :
Android post
You can find below the result of my "flutter doctor -v" and "flutter build ios -v".
flutter doctor -v :
[✓] Flutter (Channel stable, v1.9.1+hotfix.5, on Mac OS X 10.15 19A602, locale en-FR)
• Flutter version 1.9.1+hotfix.5 at /Users/axel/flutter
• Framework revision 1aedbb1835 (4 days ago), 2019-10-17 08:37:27 -0700
• Engine revision b863200c37
• Dart version 2.5.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
• Android SDK at /Users/axel/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.1
• 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.8.4
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 40.2.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.39.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.5.1
[✓] Connected device (2 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 10
(API 29) (emulator)
• iPhone 11 Pro • DB06E423-957F-41AA-99D0-05735D90C30B • ios •
com.apple.CoreSimulator.SimRuntime.iOS-13-1 (simulator)
• No issues found!
flutter build ios -v :
[ +118 ms] "flutter ios" took 19,172ms.
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)
Ok i found the problem, First i wasn't working with the stable flutter version i was with 1.10.x and going back to flutter 1.9.x-prefix.x made it run back again but the build din't work anymore, the thing that was making the build crash was that with the latest xCode version and since i was working with firebase cloud messaging i need to add back the mobile provision back in xCode part of my flutter app. – Axel Frau just now Edit Delete
i followed this tutorial : Firebase Cloud messaging to do this as on the project i'm working on somebody else did it before me.
I'm making an app with Flutter and I need to fetch some data from a Firestore database. I followed the steps to include it in the iOS Xcode project, but I get an error after Xcode build. I am not even using Firebase yet in the app.
I found this answer: App getting crash when click on GoogleSignIn button
But it does not correspond to my problem.
This is the AppDelegate.m (no error reported by Xcode):
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "GoogleMaps/GoogleMaps.h"
#import Firebase;
#implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GMSServices provideAPIKey:#"XXXX"];
[GeneratedPluginRegistrant registerWithRegistry:self];
[FIRApp configure];
// Override point for customization after application launch.
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
#end
This is the error I get:
Launching lib/main.dart on iPhone 8 in debug mode...
Running Xcode build...
Xcode build done. 7,8s
Configuring the default Firebase app...
6.0.0 - [Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not exist.
6.0.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60000000 started
6.0.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see XXXX)
Configured the default Firebase app __FIRAPP_DEFAULT.
6.0.0 - [Firebase/Core][I-COR000027] The library name (flutter-firebase_core) or version number (0.4.0+1) contain invalid characters. Only alphanumeric, dash, underscore and period characters are allowed.
*** First throw call stack:
(
0 CoreFoundation 0x000000010f5d26fb __exceptionPreprocess + 331
1 libobjc.A.dylib 0x000000010eb76ac5 objc_exception_throw + 48
2 CoreFoundation 0x000000010f5d2555 +[NSException raise:format:] + 197
3 Runner 0x00000001076ca6b6 +[FIRApp configureWithName:options:] + 326
4 Runner 0x00000001076ca54f +[FIRApp configureWithOptions:] + 143
5 Runner 0x00000001076ca47f +[FIRApp configure] + 607
6 Runner 0x000000010757e61c -[AppDelegate application:didFinishLaunchingWithOptions:] + 156
7 UIKitCore 0x0000000119a83311 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 280
8 UIKitCore 0<…>
Error connecting to the service protocol: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:54573/It0MI4dOUXE=/ws
And this is Flutter doctor output:
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.4 18E226, locale fr-FR)
• Flutter version 1.5.4-hotfix.2 at /Users/mickaeldebalme/SDK/Flutter/flutter
• Framework revision 7a4c33425d (3 weeks ago), 2019-04-29 11:05:24 -0700
• Engine revision 52c7a1e849
• Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/mickaeldebalme/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Users/mickaeldebalme/Library/Application
Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/182.5314842/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.2.1, Build version 10E1001
• ios-deploy 1.9.4
• CocoaPods version 1.6.1
[✓] Android Studio (version 3.3)
• Android Studio at /Users/mickaeldebalme/Library/Application
Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/182.5314842/Android Studio.app/Contents
• Flutter plugin version 34.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] Connected device (1 available)
• iPhone 8 • B6399A10-1F2D-44C3-8B0D-6AD086AD0F55 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-12-2 (simulator)
• No issues found!
EDIT
After creating a clean project, the error was still there.
So I did the following:
Upgrading all my plugins to the latest version
Migrating to Android X
Moving the [FIRApp configure]; above the rest of the Objective-C instructions in the AppDelegate.m (yes !)
I finally found a solution.
After creating a clean project, the error was still there. So I did the following:
Upgrading all my plugins to the latest version
Migrating to Android X
Moving the [FIRApp configure]; above the rest of the Objective-C instructions in the AppDelegate.m (yes !)