【问题标题】:Flutter build Fail, gradle :app:debugCompileClasspathFlutter 构建失败,gradle :app:debugCompileClasspath
【发布时间】:2021-09-16 19:04:25
【问题描述】:

从昨天开始,Flutter 项目停止为我构建。

它给了我这个错误

Running "flutter pub get" in promotyflutter...
Launching lib/main_prod.dart on Redmi Note 8 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all dependencies for configuration ':app:debugCompileClasspath'.
   > Problems reading data from Binary store in /tmp/gradle5564899897575971656.bin offset 447048 exists? true

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 29s
Exception: Gradle task assembleDebug failed with exit code 1


我尝试了很多东西,但到目前为止没有任何效果:

  • flutter clean,删除 pubspec.lockflutter pub cache repair 以摆脱缓存并重新安装软件包但没有运气:(
  • Flutter 降级,出现同样的错误
  • 重新安装 Flutter,同样的事情
  • 项目的新 git 克隆并尝试从 prod 分支运行,但不行。
  • 尝试将 org.gradle.parallel=false 放入 gradle 设置中。不走运:(

我以前没有遇到过这样的问题。在极少数情况下,flutter clean 曾经成功过。有什么想法吗?


这是flutter doctor -v的输出

[✓] Flutter (Channel stable, 2.2.1, on Linux, locale en_US.UTF-8)
    • Flutter version 2.2.1 at /home/bipin/snap/flutter/common/flutter
    • Framework revision 02c026b03c (6 weeks ago), 2021-05-27 12:24:44 -0700
    • Engine revision 0fdb562ac8
    • Dart version 2.13.1
                                                                                                                                                                                                  [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /home/bipin/Android/Sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_SDK_ROOT = /home/bipin/Android/Sdk
    • 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 Ultimate Edition (version 2020.3)
    • IntelliJ at /opt/idea-IU-203.7717.56
    • 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.57.1)
    • VS Code at /usr/share/code
    • Flutter extension can be installed from:
      ???? https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • Redmi Note 8 (mobile) • 169612f4 • android-arm64  • Android 10 (API 29)
    • Chrome (web)          • chrome   • web-javascript • Google Chrome 91.0.4472.114

• No issues found!

【问题讨论】:

  • 在您的 android flder /gradle/gradle-wrapper.properties 中使用 v 6.7 或更高版本distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
  • @griffins 谢谢试过了。但是遇到了同样的错误
  • @griffins 我也试过这个:distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip 在运行项目之前我也删除了.gradle。但没有运气
  • 你可能需要重新下载你的android sdk,但首先尝试删除这个文件夹Problems reading data from Binary store in /tmp/gradle5564899897575971656.bin offset 447048 exists? true

标签: android flutter gradle flutter-dependencies flutter-android


【解决方案1】:

这东西对我有用!

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

【讨论】:

  • 您好 Pravin,使用支持信息改进您的答案以便更好地理解。
猜你喜欢
  • 2019-09-08
  • 2021-05-16
  • 1970-01-01
  • 2015-08-22
  • 2014-03-30
  • 1970-01-01
相关资源
最近更新 更多