【问题标题】:Can not find out what causes my iOS app crashes in flutter无法找出导致我的 iOS 应用程序崩溃的原因
【发布时间】:2020-04-26 23:17:38
【问题描述】:

我正在使用 Flutter 作为工具来创建适用于 Android 和 iOS 的应用程序。 Android 版本运行良好,但 iOS 版本在我登录或注销应用程序后立即崩溃。我在我的应用程序中使用 Firebase。我不确定 iOS 版本为何崩溃,但我在运行日志中收到此消息。

*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff23e39f0e __exceptionPreprocess + 350
    1   libobjc.A.dylib                     0x00007fff50ad79b2 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff23e39c88 +[NSException raise:format:arguments:] + 88
    3   Foundation                          0x00007fff258a3d9b -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 166
    4   Runner                              0x0000000103d42cd7 _ZN8firebase9firestore4util16ObjcThrowHandlerENS1_13ExceptionTypeEPKcS4_iRKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 343
    5   Runner                              0x0000000103d42525 _ZN8firebase9firestore4util5ThrowENS1_13ExceptionTypeEPKcS4_iRKNSt3__<…>

更新: 我通过使用

运行该应用程序来测试它
flutter run --verbose

并收到此消息:

localhost Runner[23602]: (Foundation) *** Assertion failure in firebase::firestore::api::DocumentReference::DocumentReference(model::ResourcePath, std::shared_ptr<Firestore>)(),
/-/-/AndroidStudioProjects/qyou/ios/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_reference.cc:66
[  +77 ms] [DEVICE LOG] 2020-04-26 22:52:09.812988-0400  localhost Runner[23602]: (CoreFoundation) *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'FIRESTORE INTERNAL ASSERTION FAILED: Invalid
document reference. Document references must have an even number of segments, but users has 1'
[        ] [DEVICE LOG] *** First throw call stack:
[        ] [DEVICE LOG] (
[        ] [DEVICE LOG]     0   CoreFoundation                      0x00007fff23e39f0e __exceptionPreprocess + 350
[        ] [DEVICE LOG]     1   libobjc.A.dylib                     0x00007fff50ad79b2 objc_exception_throw + 48
[        ] [DEVICE LOG]     2   CoreFoundation                      0x00007fff23e39c88 +[NSException raise:format:arguments:] + 88
[        ] [DEVICE LOG]     3   Foundation                          0x00007fff258a3d9b -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 166
[        ] [DEVICE LOG]     4   Runner                              0x0000000100edacd7 _ZN8firebase9firestore4util16ObjcThrowHandlerENS1_13ExceptionTypeEPKcS4_iRKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 343
[        ] [DEVICE LOG]     5   Runner                              0x0000000100eda525 _ZN8firebase9firestore4util5ThrowENS1_13ExceptionTypeEPKcS4_iRKNSt3__<…>

【问题讨论】:

  • 我会确保您拥有 Google 为您提供的 plist 配置文件,以便在您的 iOS 项目中使用 Firebase。
  • plist 文件在 ios 项目中。但我仍然遇到问题

标签: ios firebase flutter


【解决方案1】:

我发现,在其中一个函数中,我传递了一个空字符串作为文档 uid,导致抛出此异常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-05-03
    • 1970-01-01
    • 1970-01-01
    • 2012-03-04
    • 2011-11-14
    • 2013-04-09
    • 1970-01-01
    • 2019-01-30
    相关资源
    最近更新 更多