Error: Problems reading data from Binary store

Error: Problems reading data from Binary store

当我尝试 运行 flutter 应用程序时,出现如下错误。

我在build.gradle

中设置了这个

classpath 'com.google.gms:google-services:4.3.3'

我在 app/build 中有这种依赖。gradle

apply plugin: 'com.google.gms.google-services'

当我删除 app/build.gradle google-services 插件时,应用程序运行良好。由于我需要 google-services 插件,我想知道如何解决这个问题。谢谢!

这是 flutter doctor -v 的输出。

[✓] Flutter (Channel stable, 2.2.3, on Linux, locale en_US.UTF-8)
    • Flutter version 2.2.3 at /opt/flutter
    • Framework revision f4abaa0735 (6 days ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /home//Android/Sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.
[✓] Chrome - develop for the web
    • Chrome at google-chrome
[✓] Android Studio (version 4.1)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 57.0.1
    • Dart plugin version 201.9380
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] IntelliJ IDEA Community Edition (version 2019.3)
    • IntelliJ at /home/
**/Office Works/Softwares/idea-IC-193.6494.35
    • Flutter plugin can be installed from:
      https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      https://plugins.jetbrains.com/plugin/6351-dart
[✓] IntelliJ IDEA Community Edition (version 2018.2)
    • IntelliJ at /opt/idea
    • Flutter plugin can be installed from:
      https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.50.1)
    • VS Code at /usr/share/code
    • Flutter extension version 3.17.0

我通过将 gradle 升级到 gradle-6.7 解决了这个问题。只需将 android/gradle/wrapper/gradle-wrapper.properties 文件上的 distributionUrl 值更改为该值:

distributionUrl=https://services.gradle.org/distributions/gradle-6.7-all.zip

或者,只需 运行 在您的 android/ 文件夹中执行此命令:

./gradlew wrapper --gradle-version 6.7

在 Android Studio Actic Fox + 中,您可以通过升级继续打开 android/gradle/wrapper/gradle-wrapper.properties 文件并在依赖项下将鼠标悬停在 gradle 上来解决此问题以获得升级建议并接受:

dependencies {
    classpath 'com.android.tools.build:gradle:7.0.1' // <--- HOVER MOUSE TO GET SUGGESTED Gradle upgrade
    classpath 'com.google.gms:google-services:4.3.10'    }

}

将下载最新的更新,应该可以解决该错误。 然后同步 gradle 就可以了。