Closed CEO-CGS closed 2 years ago
Hi @CEO-CGS
Please provide your flutter pub deps -- --style=compact
.
Thank you
Hello @markusaksli-nc. Thank you for your quick response. Here it is -
Flutter SDK 2.0.5-0.0.pre.1
gig 1.0.0+1
dependencies:
- cloud_firestore 0.16.0+1 [flutter meta quiver firebase_core firebase_core_platform_interface cloud_firestore_platform_interface cloud_firestore_web]
- cupertino_icons 1.0.2
- email_validator 2.0.1
- firebase_auth 0.20.1 [meta firebase_core firebase_core_platform_interface firebase_auth_platform_interface firebase_auth_web flutter]
- firebase_core 0.7.0 [firebase_core_platform_interface flutter quiver meta firebase_core_web]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
- flutter_launcher_icons 0.9.0 [args image path yaml]
dev dependencies:
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]
transitive dependencies:
- archive 3.1.2 [crypto path]
- args 2.0.0
- async 2.5.0 [collection]
- boolean_selector 2.1.0 [source_span string_scanner]
- characters 1.1.0
- charcode 1.2.0
- clock 1.1.0
- cloud_firestore_platform_interface 3.0.2 [flutter meta collection firebase_core plugin_platform_interface]
- cloud_firestore_web 0.3.0+2 [flutter flutter_web_plugins http_parser meta firebase_core firebase_core_web cloud_firestore_platform_interface js]
- collection 1.15.0
- crypto 3.0.1 [collection typed_data]
- fake_async 1.2.0 [clock collection]
- firebase_auth_platform_interface 3.1.0 [flutter meta firebase_core plugin_platform_interface]
- firebase_auth_web 0.3.3 [flutter flutter_web_plugins meta http_parser intl firebase_core firebase_core_web firebase_auth_platform_interface js]
- firebase_core_platform_interface 3.0.1 [flutter meta plugin_platform_interface quiver]
- firebase_core_web 0.2.1+3 [firebase_core_platform_interface flutter flutter_web_plugins meta js]
- flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math]
- http_parser 3.1.4 [charcode collection source_span string_scanner typed_data]
- image 3.0.2 [archive meta xml]
- intl 0.16.1 [path]
- js 0.6.3
- matcher 0.12.10 [stack_trace]
- meta 1.3.0
- path 1.8.0
- petitparser 4.1.0 [meta]
- plugin_platform_interface 1.0.3 [meta]
- quiver 2.1.5 [matcher meta]
- sky_engine 0.0.99
- source_span 1.8.0 [charcode collection path term_glyph]
- stack_trace 1.10.0 [path]
- stream_channel 2.1.0 [async]
- string_scanner 1.1.0 [charcode source_span]
- term_glyph 1.2.0
- test_api 0.2.19 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
- typed_data 1.3.0 [collection]
- vector_math 2.1.0
- xml 5.1.0 [collection meta petitparser]
- yaml 3.1.0 [collection source_span string_scanner]
`
This seems like a pretty obscure error so not sure what exactly could be causing it at a glance. Could you try to see if the same issue persists on the latest version cloud_firestore: ^1.0.6
?
Also it's unclear from the example you provided what part exactly could be causing the issue here. It would be really helpful if you could isolate the problem to just cloud_firestore
or what other package with cloud_firestore
causes the crash and provide a minimal complete reproducible code sample that we can run in main.dart
to test as well.
I have tried using cloud_firestore ^1.0.6 and firebase_core: ^1.0.4 now. The error is still there, even when using those two packages only.
Here is the main.dart to test -
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(title: "Hi",
home: Scaffold(
appBar: AppBar(title: const Text("lets try this!")),
floatingActionButton: FloatingActionButton(
onPressed: () => FirebaseFirestore.instance
.collection('testing')
.add({'timestamp': Timestamp.fromDate(DateTime.now())})
,
child: Icon(Icons.add),
),
body: StreamBuilder(
stream: FirebaseFirestore.instance.collection('test').snapshots(),
builder: (
BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot
){
if(!snapshot.hasData) return const SizedBox.shrink();
return ListView.builder(
itemCount: snapshot.data.docs.length,
itemBuilder: (BuildContext context, int index){
final docData = snapshot.data.docs[index].data();
final dateTime = (docData['timestamp'] as Timestamp).toDate();
return ListTile(
title: Text(dateTime.toString())
);
});
}
)),
);
}}
'FIRESTORE INTERNAL ASSERTION FAILED: threads > 1'
@ened could this be a result of the event channel refactor perhaps? I only see a single named dispatch queue in use here so don't think it's related but you may have more visibility on this since the event channel work hence looping you in π
Tried the provided code but didn't see a crash with
firebase_core: ^1.1.0
cloud_firestore: ^1.0.7
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '7.11.0'
Hi @CEO-CGS could you please share more details, for example the package.lock file in your project. Also, please share a few details on how the problem can be reproduced. I will try to look at the issues using the FIXED versions specified above, first; but obviously want to avoid double work.
hi @CEO-CGS I was not able to reproduce this error at all. Please find the sample project here: https://github.com/ened/flutterfire_5856
If you can modify it to crash, then we can take another detail look, else voting to close this ticket.
Hello. I download and tried running the sample project provided. In my case it did crash. I went through the following steps before running the project though: I updated the signing section in Xcode, I changed the bundle id and google-services-info.plist file. I did flutter upgrade, pod repo update, pod update, edited the build targets and then I ran it. This is the error that shows up. (Maybe it is slightly different than before?)
2021-05-01` 15:39:07.302285-0700 Runner[6696:63298] Metal API Validation Enabled
2021-05-01 15:39:07.360304-0700 Runner[6696:63298] MTLCreateSystemDefaultDevice() zero devices
2021-05-01 15:39:08.167198-0700 Runner[6696:63596] flutter: Observatory listening on http://127.0.0.1:50437/1hwF7lBxVOM=/
2021-05-01 15:39:08.470688-0700 Runner[6696:63580] 7.3.0 - [Firebase/Core][I-COR000005] No app has been configured yet.
2021-05-01 15:39:12.530871-0700 Runner[6696:63581] *** Assertion failure in static std::unique_ptr<Executor> firebase::firestore::util::Executor::CreateConcurrent(const char *, int)(), /Users/hassanwarsi/Downloads/flutterfire_5856-main/ios/Pods/FirebaseFirestore/Firestore/core/src/util/executor_libdispatch.mm:368
2021-05-01 15:39:12.609938-0700 Runner[6696:63581] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'FIRESTORE INTERNAL ASSERTION FAILED: threads > 1'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff20422fba __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007fff20193ff5 objc_exception_throw + 48
2 CoreFoundation 0x00007fff20422de3 +[NSException raise:format:] + 0
3 Foundation 0x00007fff207749b0 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 166
4 FirebaseFirestore 0x00000001014eda27 _ZN8firebase9firestore4util16ObjcThrowHandlerENS1_13ExceptionTypeEPKcS4_iRKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 343
5 FirebaseFirestore 0x00000001014ecf85 _ZN8firebase9firestore4util5ThrowENS1_13ExceptionTypeEPKcS4_iRKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 53
6 FirebaseFirestore 0x000000010164269d _ZN8firebase9firestore4util8internal13FailAssertionEPKcS4_iRKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 45
7 FirebaseFirestore 0x0000000101642751 _ZN8firebase9firestore4util8internal13FailAssertionEPKcS4_iRKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEES4_ + 177
8 FirebaseFirestore 0x00000001014eff7e _ZN8firebase9firestore4util8Executor16CreateConcurrentEPKci + 94
9 FirebaseFirestore 0x0000000101686907 _ZN8firebase9firestore5local26LevelDbRemoteDocumentCacheC2EPNS1_18LevelDbPersistenceEPNS1_15LocalSerializerE + 327
10 FirebaseFirestore 0x0000000101686a85 _ZN8firebase9firestore5local26LevelDbRemoteDocumentCacheC1EPNS1_18LevelDbPersistenceEPNS1_15LocalSerializerE + 37
11 FirebaseFirestore 0x00000001016804e7 _ZN4absl14lts_2020_02_2511make_uniqueIN8firebase9firestore5local26LevelDbRemoteDocumentCacheEJPNS4_18LevelDbPersistenceEPNS4_15LocalSerializerEEEENS0_15memory_internal16MakeUniqueResultIT_E6scalarEDpOT0_ + 103
12 FirebaseFirestore 0x00000001016800a8 _ZN8firebase9firestore5local18LevelDbPersistenceC2ENSt3__110unique_ptrIN7leveldb2DBENS3_14default_deleteIS6_EEEENS0_4util4PathENS3_3setINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS3_4lessISI_EENSG_ISI_EEEENS1_15LocalSerializerERKNS1_9LruParamsE + 536
13 FirebaseFirestore 0x000000010167fd8d _ZN8firebase9firestore5local18LevelDbPersistenceC1ENSt3__110unique_ptrIN7leveldb2DBENS3_14default_deleteIS6_EEEENS0_4util4PathENS3_3setINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS3_4lessISI_EENSG_ISI_EEEENS1_15LocalSerializerERKNS1_9LruParamsE + 29
14 FirebaseFirestore 0x000000010167f2c4 _ZN8firebase9firestore5local18LevelDbPersistence6CreateENS0_4util4PathENS1_15LocalSerializerERKNS1_9LruParamsE + 932
15 FirebaseFirestore 0x000000010167bb80 _ZN8firebase9firestore5local13LevelDbOpener6CreateERKNS1_9LruParamsE + 640
16 FirebaseFirestore 0x0000000101572a7b _ZN8firebase9firestore4core15FirestoreClient10InitializeERKNS0_4auth4UserERKNS0_3api8SettingsE + 379
17 FirebaseFirestore 0x000000010157d2ad _ZZZN8firebase9firestore4core15FirestoreClient6CreateERKNS1_12DatabaseInfoERKNS0_3api8SettingsENSt3__110shared_ptrINS0_4auth19CredentialsProviderEEENSB_INS0_4util8ExecutorEEENSB_INSF_10AsyncQueueEEENSA_10unique_ptrINS0_6remote24FirebaseMetadataProviderENSA_14default_deleteISM_EEEEEN3$_2clENSC_4UserEENKUlvE_clEv + 61
18 FirebaseFirestore 0x000000010157d24d _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 0x000000010157d1fd _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 0x000000010157d1cd _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 0x000000010157bdfe _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 0x0000000101456fa5 _ZNKSt3__110__function12__value_funcIFvvEEclEv + 53
23 FirebaseFirestore 0x0000000101454595 _ZNKSt3__18functionIFvvEEclEv + 21
24 FirebaseFirestore 0x00000001014544fa _ZN8firebase9firestore4util10AsyncQueue15ExecuteBlockingERKNSt3__18functionIFvvEEE + 186
25 FirebaseFirestore 0x0000000101459391 _ZZN8firebase9firestore4util10AsyncQueue4WrapERKNSt3__18functionIFvvEEEENK3$_0clEv + 33
26 FirebaseFirestore 0x000000010145934d _ZNSt3__1L8__invokeIRZN8firebase9firestore4util10AsyncQueue4WrapERKNS_8functionIFvvEEEE3$_0JEEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOSC_DpOSD_ + 29
27 FirebaseFirestore 0x00000001014592fd _ZNSt3__128__invoke_void_return_wrapperIvE6__callIJRZN8firebase9firestore4util10AsyncQueue4WrapERKNS_8functionIFvvEEEE3$_0EEEvDpOT_ + 29
28 FirebaseFirestore 0x00000001014592cd _ZNSt3__110__function12__alloc_funcIZN8firebase9firestore4util10AsyncQueue4WrapERKNS_8functionIFvvEEEE3$_0NS_9allocatorISB_EES7_EclEv + 29
29 FirebaseFirestore 0x000000010145804e _ZNSt3__110__function6__funcIZN8firebase9firestore4util10AsyncQueue4WrapERKNS_8functionIFvvEEEE3$_0NS_9allocatorISB_EES7_EclEv + 30
30 FirebaseFirestore 0x0000000101456fa5 _ZNKSt3__110__function12__value_funcIFvvEEclEv + 53
31 FirebaseFirestore 0x0000000101454595 _ZNKSt3__18functionIFvvEEclEv + 21
32 FirebaseFirestore 0x000000010187a635 _ZN8firebase9firestore4util4Task17ExecuteAndReleaseEv + 229
33 FirebaseFirestore 0x00000001014ee9ad _ZN8firebase9firestore4util19ExecutorLibdispatch11InvokeAsyncEPv + 29
34 libdispatch.dylib 0x0000000107cd374e _dispatch_client_callout + 8
35 libdispatch.dylib 0x0000000107cd9f9a _dispatch_lane_serial_drain + 796
36 libdispatch.dylib 0x0000000107cdac67 _dispatch_lane_invoke + 436
37 libdispatch.dylib 0x0000000107ce6a7a _dispatch_workloop_worker_thread + 872
38 libsystem_pthread.dylib 0x00007fff6033f499 _pthread_wqthread + 314
39 libsystem_pthread.dylib 0x00007fff6033e467 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.5 - Device: iPhone 12 (B161D373-CDF3-4E02-A510-A7B855E99FBD) - Runtime: iOS 14.5 (18E182) - DeviceType: iPhone 12
(lldb) ```
I also recently installed the most recent stable version of Xcode, and @markusaksli-nc, I tried running the sample project provided by @ened with the updated packages you provided but I received this error - 1. Did not find header 'FLTFirebasePluginRegistry.h' in framework 'FirebaseCore'
@CEO-CGS seems to load just fine here:
2021-05-02 09:47:29.168440+0100 Runner[45690:5087602] Metal API Validation Enabled
2021-05-02 09:47:29.345977+0100 Runner[45690:5087602] Warning: Unable to create restoration in progress marker file
2021-05-02 09:47:29.369044+0100 Runner[45690:5088251] 7.3.0 - [Firebase/Core][I-COR000005] No app has been configured yet.
2021-05-02 09:47:29.414015+0100 Runner[45690:5088285] flutter: Observatory listening on http://127.0.0.1:51218/2TM6xqTRAig=/
Could you give it a go to adjust the pubspec dependencies
dependencies:
cloud_firestore: 1.0.6
firebase_core: 1.0.4
flutter:
sdk: flutter
Maybe remove firebase_core (comes through cloud_firestore) and use cloud_firestore: ^1.0.7
, then do the flutter clean
, flutter pub get
flutter build ios
dance and try again.
I tried removing firebase_core and used cloud_firestore 1.0.7, and did the steps, and I got another type of error... Here is a link to the entire 'build failed' message. I'm not too sure what the error here is - https://docs.google.com/document/d/1YuJSiwiIlfnk53EL9Km4ORgxWl4SUYi-oSKkryv-skE/edit?usp=sharing
@CEO-CGS very strange - the error points to outdated cocoapods dependencies still. I have upgraded cloud_firestore
dependency now and updated the repository. Please pull the new version from https://github.com/ened/flutterfire_5856.
Once pulled, please run git clean -xfd
, then flutter pub get
, cd ios && pod update && cd -
, then try to build the App again on the command line: flutter build ios --debug --no-codesign
.
@ened, unfortunately, this does not seem to fix it either. I went through all the steps provided, and here is the link to the full error message. I think it might be the same one, or similar - https://docs.google.com/document/d/1_IQKUjiilLzRRB9s1ZL6kwu0-7-Sz0hDXHyI5WOwpbw/edit?usp=sharing
Can you try to remove your pods cache: rm -rf ~/Library/Caches/CocoaPods
and then try again - I'm starting to wonder if you had a incomplete download or something like that. Once done, please do the git clean
.. etc dance as above again. Thank you.
Hey @ened. Here are the results. https://docs.google.com/document/d/1ZV5lYJvb0RNha9zpSe2KkUVp0V52wxrXyeh1FXdPvj0/edit?usp=sharing Sadly, it still did not work. Please check my commands on the doc to see if I made the wrong commands and the full output.
Any solution yet?
Anything new anyone? Still hoping to use Firebase in one of my flutter projects....
@CEO-CGS, Have you tried on a completely fresh application? By the way, the error suggests to me that you're initialising Firebase twice. So maybe double check you aren't initialising in your Swift code and Dart.
Closing due to inactivity.
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 for a number of days now.
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:
Here is my flutter doctor -v results as well if needed:
Here is the code sample I try to run -
Wrapper class -