Flutterfire Firestore抛出了“ OA&#x27的实例”。是null'听

发布于 2025-02-11 22:55:54 字数 1797 浏览 1 评论 0原文

我将数据从firestore加载到我的flutter应用程序中。为此,我使用Flutterfire Firestore ODM。在iOS模拟器和Release Android应用程序上一切正常。但是在版本的iOS应用程序上,我会收到以下错误,而没有进一步的解释:

'oa'实例。错误丢弃。

其他请求正常工作。

我无法弄清楚什么是错误的,也找不到在线答案。在firebase crashlytics中,我可以看到以下内容:

Non-fatal Exception: FlutterError
0  ???                            0x0 (null).    #00 abs 0 _kDartIsolateSnapshotInstructions+0x167a27
1  ???                            0x0 (null).    #01 abs 0 _kDartIsolateSnapshotInstructions+0x167a87
2  ???                            0x0 (null).    #02 abs 0 _kDartIsolateSnapshotInstructions+0x169b9b
3  ???                            0x0 (null).    #03 abs 0 _kDartIsolateSnapshotInstructions+0x1699bb
4  ???                            0x0 (null).    #04 abs 0 _kDartIsolateSnapshotInstructions+0x16995f
(this continues until line 59)

我的代码:

FirestoreBuilder(
  ref: context.read<VacationRepository>().getDashboardVactions(),
  builder: (context, AsyncSnapshot<VacationEntityQuerySnapshot> snapshot, child) {
    if (snapshot.connectionState == ConnectionState.waiting) {
      return ReuseableWidgets.linearSpinner;
    }

    if (snapshot.hasError) {
      FirebaseCrashlytics.instance.recordError(
        snapshot.error,
        snapshot.stackTrace,
      );
      // ^ this is where the error is caught
      return ReuseableWidgets.somethingWentWrong;
    }
...

getDashboardVacations() is:

FirestoreListenable<VacationEntityQuerySnapshot> getDashboardVactions() {
  String currentUser = _authenticationRepository.currentUser.id;
  return vacationsRef.whereMembers(arrayContainsAny: [currentUser]);
}

I load data from Firestore into my Flutter app. For that I use the Flutterfire Firestore ODM. Everything works fine on the iOS Simulators and the release android app. But on the release iOS app I get the following error with no further explanation:

Instance of 'OA'. Error thrown null.

Other requests work just fine.

I cannot figure out what is wrong and cannot find an answer to this online. In Firebase Crashlytics I get to see this:

Non-fatal Exception: FlutterError
0  ???                            0x0 (null).    #00 abs 0 _kDartIsolateSnapshotInstructions+0x167a27
1  ???                            0x0 (null).    #01 abs 0 _kDartIsolateSnapshotInstructions+0x167a87
2  ???                            0x0 (null).    #02 abs 0 _kDartIsolateSnapshotInstructions+0x169b9b
3  ???                            0x0 (null).    #03 abs 0 _kDartIsolateSnapshotInstructions+0x1699bb
4  ???                            0x0 (null).    #04 abs 0 _kDartIsolateSnapshotInstructions+0x16995f
(this continues until line 59)

My Code:

FirestoreBuilder(
  ref: context.read<VacationRepository>().getDashboardVactions(),
  builder: (context, AsyncSnapshot<VacationEntityQuerySnapshot> snapshot, child) {
    if (snapshot.connectionState == ConnectionState.waiting) {
      return ReuseableWidgets.linearSpinner;
    }

    if (snapshot.hasError) {
      FirebaseCrashlytics.instance.recordError(
        snapshot.error,
        snapshot.stackTrace,
      );
      // ^ this is where the error is caught
      return ReuseableWidgets.somethingWentWrong;
    }
...

and getDashboardVacations() is:

FirestoreListenable<VacationEntityQuerySnapshot> getDashboardVactions() {
  String currentUser = _authenticationRepository.currentUser.id;
  return vacationsRef.whereMembers(arrayContainsAny: [currentUser]);
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

等数载,海棠开 2025-02-18 22:55:54

我不知道发生了什么或是如何发生,但是当使构建混淆时,此功能破裂了。

因此,只需删除- obfuscate映射即可再次起作用。

I do not know what or how it happens, but when obfuscating the build this feature broke.

So just remove the --obfuscate map and it works again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文