我将数据从Firestore加载到我的颤振应用程序中。为此,我使用了Flutterfire Firestore ODM。在iOS模拟器和发布的安卓应用程序上,一切都很好。但是在发布的iOS应用程序中,我得到了以下错误,但没有进一步解释:
Instance of 'OA'. Error thrown null.
其他的请求也能正常工作。
我不知道哪里出了问题,也无法在网上找到答案。在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()是:
FirestoreListenable<VacationEntityQuerySnapshot> getDashboardVactions() {
String currentUser = _authenticationRepository.currentUser.id;
return vacationsRef.whereMembers(arrayContainsAny: [currentUser]);
}发布于 2022-07-03 14:10:13
我不知道会发生什么,也不知道如何发生,但是当混淆构建时,这个特性就崩溃了。
因此,只要移除--obfuscate映射,它就会再次工作。
https://stackoverflow.com/questions/72800130
复制相似问题