Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app crash when use cloud firestore in ios simulator #2736

Closed
Ahmedtaha123 opened this issue Jun 10, 2020 · 4 comments
Closed

app crash when use cloud firestore in ios simulator #2736

Ahmedtaha123 opened this issue Jun 10, 2020 · 4 comments
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested.

Comments

@Ahmedtaha123
Copy link

Ahmedtaha123 commented Jun 10, 2020

my app work fine in android but when i run it in simulator it crash and give me this error

`
First throw call stack:
(
0 CoreFoundation 0x00007fff23e3cf0e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff50ba89b2 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23e3cc88 +[NSException raise:format:arguments:] + 88
3 Foundation 0x00007fff258b8c9b -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 166
4 Runner 0x00000001032429e7 ZN8firebase9firestore4util16ObjcThrowHandlerENS1_13ExceptionTypeEPKcS4_iRKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 343
5 Runner 0x0000000103242235 ZN8firebase9firestore4util5ThrowENS1_13ExceptionTypeEPKcS4_iRKNSt3
<…>
Exited (sigterm)

`

@TahaTesser
Copy link

Hi @Ahmedtaha123
Can you please provide your flutter doctor -v, your flutter run --verbose while running on simulator and a minimal complete reproducible code sample.
Thank you

@TahaTesser TahaTesser added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Jun 10, 2020
@luckyhandler
Copy link

luckyhandler commented Jun 25, 2020

Hey @TahaTesser, I have a similar problem. The output of my flutter doctor -v is:

▶ flutter doctor -v   
[✓] Flutter (Channel beta, 1.19.0-4.2.pre, on Mac OS X 10.15.5 19F101, locale de-DE)
    • Flutter version 1.19.0-4.2.pre at /Users/ninohandler/Development/sdks/flutter
    • Framework revision 9b9b543d92 (vor 3 Tagen), 2020-06-22 12:19:28 -0700
    • Engine revision 9a28c3bcf4
    • Dart version 2.9.0 (build 2.9.0-14.1.beta)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/ninohandler/Development/sdks/android
    • Platform android-29, build-tools 29.0.2
    • ANDROID_HOME = /Users/ninohandler/Development/sdks/android
    • Java binary at: /Applications/Android Studio 4.0 Preview.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 11.5)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.5, Build version 11E608c
    • CocoaPods version 1.9.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio
    • Android Studio at /Applications/Android Studio 4.1 Preview.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio 4.0 Preview.app/Contents
    • Flutter plugin version 46.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] IntelliJ IDEA Community Edition (version 2020.1.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 46.0.3
    • Dart plugin version 201.7846.93

[✓] VS Code (version 1.46.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.10.2

[✓] Connected device (4 available)
    • iPhone 11 Pro     • 8CFB02B6-E239-4313-837E-201D444D1D98 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)
    • iPhone 11 Pro Max • DC100F07-A74A-44AA-A2E3-467EB045BB03 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)
    • Web Server        • web-server                           • web-javascript • Flutter Tools
    • Chrome            • chrome                               • web-javascript • Google Chrome 83.0.4103.116

! Doctor found issues in 1 category.

I tried the same on flutter's master branch which doesn't compile and on stable which causes the same error.

The issue's stacktrace is:

#0	0x0000000108666395 in std::__1::unique_ptr<firebase::firestore::util::Status::State, firebase::firestore::util::Status::State::Deleter>::operator bool() const at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2636
#1	0x0000000108666369 in bool std::__1::operator==<firebase::firestore::util::Status::State, firebase::firestore::util::Status::State::Deleter>(std::__1::unique_ptr<firebase::firestore::util::Status::State, firebase::firestore::util::Status::State::Deleter> const&, std::nullptr_t) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3001
#2	0x0000000108666339 in firebase::firestore::util::Status::ok() const at /Users/ninohandler/Development/app/ios/Pods/FirebaseFirestore/Firestore/core/src/util/status.h:82
#3	0x000000010879c758 in firebase::firestore::util::StatusOr<std::__1::unique_ptr<leveldb::DB, std::__1::default_delete<leveldb::DB> > >::ok() const at /Users/ninohandler/Development/app/ios/Pods/FirebaseFirestore/Firestore/core/src/util/statusor.h:170
Enqueued from com.apple.main-thread (Thread 1) Queue : com.apple.main-thread (serial)
#0	0x00000001112e870b in _dispatch_async_f_slow ()
#1	0x0000000108617045 in firebase::firestore::util::ExecutorLibdispatch::Execute(std::__1::function<void ()>&&) at /Users/ninohandler/Development/app/ios/Pods/FirebaseFirestore/Firestore/core/src/util/executor_libdispatch.mm:115
#2	0x00000001085998f1 in firebase::firestore::util::AsyncQueue::EnqueueRelaxed(std::__1::function<void ()> const&) at /Users/ninohandler/Development/app/ios/Pods/FirebaseFirestore/Firestore/core/src/util/async_queue.cc:118
#3	0x000000010859983d in firebase::firestore::util::AsyncQueue::Enqueue(std::__1::function<void ()> const&) at /Users/ninohandler/Development/app/ios/Pods/FirebaseFirestore/Firestore/core/src/util/async_queue.cc:96
#4	0x0000000108697229 in firebase::firestore::core::FirestoreClient::Create(firebase::firestore::core::DatabaseInfo const&, firebase::firestore::api::Settings const&, std::__1::shared_ptr<firebase::firestore::auth::CredentialsProvider>, std::__1::shared_ptr<firebase::firestore::util::Executor>, std::__1::shared_ptr<firebase::firestore::util::AsyncQueue>)::$_2::operator()(firebase::firestore::auth::User) at /Users/ninohandler/Development/app/ios/Pods/FirebaseFirestore/Firestore/core/src/core/firestore_client.cc:128
#5	0x00000001086970a6 in decltype(std::__1::forward<firebase::firestore::core::FirestoreClient::Create(firebase::firestore::core::DatabaseInfo const&, firebase::firestore::api::Settings const&, std::__1::shared_ptr<firebase::firestore::auth::CredentialsProvider>, std::__1::shared_ptr<firebase::firestore::util::Executor>, std::__1::shared_ptr<firebase::firestore::util::AsyncQueue>)::$_2&>(fp)(std::__1::forward<firebase::firestore::auth::User>(fp0))) std::__1::__invoke<firebase::firestore::core::FirestoreClient::Create(firebase::firestore::core::DatabaseInfo const&, firebase::firestore::api::Settings const&, std::__1::shared_ptr<firebase::firestore::auth::CredentialsProvider>, std::__1::shared_ptr<firebase::firestore::util::Executor>, std::__1::shared_ptr<firebase::firestore::util::AsyncQueue>)::$_2&, firebase::firestore::auth::User>(firebase::firestore::core::FirestoreClient::Create(firebase::firestore::core::DatabaseInfo const&, firebase::firestore::api::Settings const&, std::__1::shared_ptr<firebase::firestore::auth::CredentialsProvider>, std::__1::shared_ptr<firebase::firestore::util::Executor>, std::__1::shared_ptr<firebase::firestore::util::AsyncQueue>)::$_2&, firebase::firestore::auth::User&&) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/type_traits:4425
#6	0x0000000108697032 in void std::__1::__invoke_void_return_wrapper<void>::__call<firebase::firestore::core::FirestoreClient::Create(firebase::firestore::core::DatabaseInfo const&, firebase::firestore::api::Settings const&, std::__1::shared_ptr<firebase::firestore::auth::CredentialsProvider>, std::__1::shared_ptr<firebase::firestore::util::Executor>, std::__1::shared_ptr<firebase::firestore::util::AsyncQueue>)::$_2&, firebase::firestore::auth::User>(firebase::firestore::core::FirestoreClient::Create(firebase::firestore::core::DatabaseInfo const&, firebase::firestore::api::Settings const&, std::__1::shared_ptr<firebase::firestore::auth::CredentialsProvider>, std::__1::shared_ptr<firebase::firestore::util::Executor>, std::__1::shared_ptr<firebase::firestore::util::AsyncQueue>)::$_2&, firebase::firestore::auth::User&&) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__functional_base:348
#7	0x0000000108696fe2 in std::__1::__function::__alloc_func<firebase::firestore::core::FirestoreClient::Create(firebase::firestore::core::DatabaseInfo const&, firebase::firestore::api::Settings const&, std::__1::shared_ptr<firebase::firestore::auth::CredentialsProvider>, std::__1::shared_ptr<firebase::firestore::util::Executor>, std::__1::shared_ptr<firebase::firestore::util::AsyncQueue>)::$_2, std::__1::allocator<firebase::firestore::core::FirestoreClient::Create(firebase::firestore::core::DatabaseInfo const&, firebase::firestore::api::Settings const&, std::__1::shared_ptr<firebase::firestore::auth::CredentialsProvider>, std::__1::shared_ptr<firebase::firestore::util::Executor>, std::__1::shared_ptr<firebase::firestore::util::AsyncQueue>)::$_2>, void (firebase::firestore::auth::User)>::operator()(firebase::firestore::auth::User&&) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:1533
#8	0x0000000108695d03 in std::__1::__function::__func<firebase::firestore::core::FirestoreClient::Create(firebase::firestore::core::DatabaseInfo const&, firebase::firestore::api::Settings const&, std::__1::shared_ptr<firebase::firestore::auth::CredentialsProvider>, std::__1::shared_ptr<firebase::firestore::util::Executor>, std::__1::shared_ptr<firebase::firestore::util::AsyncQueue>)::$_2, std::__1::allocator<firebase::firestore::core::FirestoreClient::Create(firebase::firestore::core::DatabaseInfo const&, firebase::firestore::api::Settings const&, std::__1::shared_ptr<firebase::firestore::auth::CredentialsProvider>, std::__1::shared_ptr<firebase::firestore::util::Executor>, std::__1::shared_ptr<firebase::firestore::util::AsyncQueue>)::$_2>, void (firebase::firestore::auth::User)>::operator()(firebase::firestore::auth::User&&) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:1707
#9	0x00000001086747dd in std::__1::__function::__value_func<void (firebase::firestore::auth::User)>::operator()(firebase::firestore::auth::User&&) const at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:1860
#10	0x00000001086715b8 in std::__1::function<void (firebase::firestore::auth::User)>::operator()(firebase::firestore::auth::User) const at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:2419
#11	0x0000000108672694 in firebase::firestore::auth::FirebaseCredentialsProvider::SetCredentialChangeListener(std::__1::function<void (firebase::firestore::auth::User)>) at /Users/ninohandler/Development/app/ios/Pods/FirebaseFirestore/Firestore/core/src/auth/firebase_credentials_provider_apple.mm:140
#12	0x000000010868e7be in firebase::firestore::core::FirestoreClient::Create(firebase::firestore::core::DatabaseInfo const&, firebase::firestore::api::Settings const&, std::__1::shared_ptr<firebase::firestore::auth::CredentialsProvider>, std::__1::shared_ptr<firebase::firestore::util::Executor>, std::__1::shared_ptr<firebase::firestore::util::AsyncQueue>) at /Users/ninohandler/Development/app/ios/Pods/FirebaseFirestore/Firestore/core/src/core/firestore_client.cc:141
#13	0x0000000108675f03 in firebase::firestore::api::Firestore::EnsureClientConfigured() at /Users/ninohandler/Development/app/ios/Pods/FirebaseFirestore/Firestore/core/src/api/firestore.cc:209
#14	0x000000010867605b in firebase::firestore::api::Firestore::GetDocument(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) at /Users/ninohandler/Development/app/ios/Pods/FirebaseFirestore/Firestore/core/src/api/firestore.cc:124
#15	0x00000001086ddfb5 in -[FIRFirestore documentWithPath:] at /Users/ninohandler/Development/app/ios/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestore.mm:199
#16	0x0000000108b5edcc in getDocumentReference at /Users/ninohandler/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.13.7/ios/Classes/FLTCloudFirestorePlugin.m:23
#17	0x0000000108b5ac94 in -[FLTCloudFirestorePlugin handleMethodCall:result:] at /Users/ninohandler/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.13.7/ios/Classes/FLTCloudFirestorePlugin.m:609
#18	0x000000010b230fd2 in __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke ()

I guess the problem is in this part of the code (status.h, l.80 ff.):

  /// Returns true iff the status indicates success.
  bool ok() const {
    return state_ == nullptr;
  }

It causes Thread 34: EXC_BAD_ACCESS (code=1, address=0xffffffffffffffc0)

This happens anytime I try to access firestore.

I use the following google/firebase-related plugins:

  # firebase
  firebase_core: ^0.4.5

  # storage
  firebase_storage: ^3.1.6
  cloud_firestore: ^0.13.7

  # push notifications
  firebase_messaging: ^6.0.16

  # authentication
  firebase_auth: ^0.16.1

  # third-party logins
  google_sign_in: ^4.5.1

@luckyhandler
Copy link

My crash is fixed after applying this suggestion: #2751

@Salakar
Copy link
Member

Salakar commented Jul 10, 2020

Hey this has been fixed as part of #2582 / #2913 - pending release.

@Salakar Salakar closed this as completed Jul 10, 2020
@firebase firebase locked and limited conversation to collaborators Aug 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested.
Projects
None yet
Development

No branches or pull requests

4 participants