颤振应用程序在发布模式下无法正常工作

问题描述

我有一个 Flutter 应用程序,它在调试模式下工作得很好,但是在发布模式下运行时,它可以工作但不会从 firestore 中获取数据,并且没有错误消息或任何东西......这个是获取数据的方法

 Future<List<SectionModel>?> showSections() async {
    var userInfo = await udb.getUserInfo();
    List<String> userCode = userInfo != null ? userInfo.codes : [];
    List<SectionModel> sections = [];
    try {
      var sectionInfo = await _coursesCollection.where("sectionCode",whereIn: userCode).get();
      var data = sectionInfo.docs
          .map((section) => SectionModel?.fromMap(section.data()))
          .toList();
      if(data.isNotEmpty) {
        sections = data;
        return sections;
      } else {
        return [];
      }
    } on Exception catch (e) {
      Warnings.showSnackBar(
          "db problem","Could not fetch the section information !!");
    }
  }

仅在发布模式下,应用程序在 Snackbar 中向我显示此消息:“数据库问题”、“无法获取部分信息 !!....

这是 firestore 中的安全规则,我在我的应用中使用了电话身份验证:

rules_version = '2';
// Allow read/write access on all documents to any user signed in to the application
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read,write: if request.auth != null;
    }
  }
}

这是我在 Logcat(错误)中发现的一部分:

2021-06-18 12:33:06.441 3945-4040/? E/storaged: getdiskStats Failed with result NOT_SUPPORTED and size 0
2021-06-18 12:33:06.547 3844-23251/? E/audioflinger: stageIndex is 0,get default sink buf
2021-06-18 12:33:07.751 4308-4417/? E/MotionRecognitionService: handleMessage: event 200 value : 1
2021-06-18 12:33:15.066 4308-4935/? E/Watchdog: !@Sync 2751 [2021-06-18 12:33:15.065] FD count : 563
2021-06-18 12:33:17.617 14880-27368/? E/memtrack: Couldn't load memtrack module
2021-06-18 12:33:18.181 4308-4417/? E/MotionRecognitionService: handleMessage: event 200 value : 1
2021-06-18 12:33:45.084 4308-4935/? E/Watchdog: !@Sync 2752 [2021-06-18 12:33:45.084] FD count : 563
2021-06-18 12:34:06.445 3945-4040/? E/storaged: getdiskStats Failed with result NOT_SUPPORTED and size 0
2021-06-18 12:34:15.098 4308-4935/? E/Watchdog: !@Sync 2753 [2021-06-18 12:34:15.098] FD count : 563
2021-06-18 12:34:28.091 327-327/? E/fb4a.MsysMqttTopicsProvider: subscribing to mqtt
2021-06-18 12:34:29.899 15003-23169/? E/AuthPII: [GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION. Account: Account {name=osama@itdar.com,type=com.google},App: com.android.vending,Service: oauth2:https://www.googleapis.com/auth/googleplay
    uto: Long live credential not available.
        at hnx.a(:com.google.android.gms@212116028@21.21.16 (100400-378233385):13)
        at hoa.e(:com.google.android.gms@212116028@21.21.16 (100400-378233385):1)
        at hml.l(:com.google.android.gms@212116028@21.21.16 (100400-378233385):44)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)