首页 > 解决方案 > 任务 ':app:compileDebugJavaWithJavac' 执行失败。扑

问题描述

我的项目进展顺利,直到我运行flutter clean然后尝试在 android 上运行我的应用程序,我得到了这个错误

    FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

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

标签: flutter

解决方案


当您的应用程序的依赖项与您的开发环境不兼容时,很可能会出现此问题。

在以下 SO 帖子中,此错误的最佳解决方案是更新依赖项,如上面评论中所述。要备份参考资料,您可以参考此 SO 帖子,其中展示了遇到的问题:


推荐阅读