【问题标题】:Update new version is not working in flutter更新新版本无法正常工作
【发布时间】:2022-08-02 14:21:18
【问题描述】:

我有一个带有更新按钮的颤振应用程序。这用于在 Play 商店中有新版本时进行更新。直到几天前它都可以正常工作。但现在它不起作用。它仅在用户安装相同版本时显示通知,否则将引发错误。

> 2022-07-04 12:01:39.072 27969-28023/? E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Bad state: No element
    #0      ListMixin.firstWhere (dart:collection/list.dart:167)
    #1      NewVersion._getAndroidStoreVersion (package:new_version/new_version.dart:157)
    <asynchronous suspension>
    #2      _SettingsPageState._checkVersion (package:bnews/ui_components/pages/settings_page.dart:196)
    <asynchronous suspension>

所以现在我无法使用此更新按钮更新我的应用程序。我使用 new_version 颤振包进行更新。这是代码

      void _checkVersion() async {
   final newVersion = NewVersion(
      androidId: \"com.abc.def\",
    );
    final status = await newVersion.getVersionStatus();
    newVersion.showUpdateDialog(
      context: context,
      versionStatus: status!,
      dialogTitle: \"UPDATE!!!\",
      dialogText: \"Please update the app from \" + \"${status.localVersion}\" + \" to \" + \"${status.storeVersion}\",
      updateButtonText: \"Lets update\",
    );
  }

我认为没有找到包的问题是存在的。但是直到几天前它都可以正常工作。我也更新了 new_version 包,但仍然存在同样的问题。这是playstore的问题吗?

    标签: flutter flutter-dependencies google-play-console flutter-packages


    【解决方案1】:

    这是一个错误检查 pub.dev new_version 问题

    【讨论】:

      猜你喜欢
      • 2019-07-04
      • 1970-01-01
      • 2023-04-07
      • 2017-08-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-10
      相关资源
      最近更新 更多