失败:构建失败,出现异常-Flutter

时间:2020-09-21 17:35:54

标签: android flutter dart exception

我试图构建我的应用程序,但它总是返回此奇怪的错误:-

Launching lib\main.dart on M2003J15SC in debug mode...

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':location:compileDebugJavaWithJavac'.
> File 'C:\Native\findhelpapp\findhelpapp\build\location\intermediates\annotation_processor_list\debug\annotationProcessors.json' specified for property 'processorListFile' does not exist.

* 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 52s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

我试图运行flutter clean并重建项目,但它也无法正常工作:“(

那我该怎么解决这个错误?

我的flutter doctor日志:-

C:\Native\findhelpapp\findhelpapp>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.20.4, on Microsoft Windows [Version 10.0.18362.1082], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 3.6)
[√] IntelliJ IDEA Community Edition (version 2019.3)
[√] VS Code (version 1.49.1)
[√] Connected device (1 available)

• No issues found!

C:\Native\findhelpapp\findhelpapp>

1 个答案:

答案 0 :(得分:0)

  1. 检查Android SDK和Jdk位置

2。在gradle.properties的末尾复制下一行

android.useAndroidX = true

android.enableJetifier = true

  1. 并设置最新版本

在app \ build.gradle文件上

android {
 compileSdkVersion 28

defaultConfig {
minSdkVersion 21
targetSdkVersion 28
multiDexEnabled true

}

4。然后运行您的应用 获得