flutter - 任务 ':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)
解决方案
当您的应用程序的依赖项与您的开发环境不兼容时,很可能会出现此问题。
在以下 SO 帖子中,此错误的最佳解决方案是更新依赖项,如上面评论中所述。要备份参考资料,您可以参考此 SO 帖子,其中展示了遇到的问题:
推荐阅读
- javascript - 让 babel 自动转译
- javascript - 从 api 获取新数据
- javascript - 如何在反应js中传递一个函数来形成输入值?
- haskell - 在用户定义类型和现有类型之间定义已经存在(例如在 Prelude 中)运算符的正确方法是什么?
- scala - 具有案例等级评级的 ALS 训练数据
- python - Pandas 中的线性模型
- python - Python 文件上传更改校验和
- python - 如何从 Ableton Live 控制表面脚本向我的 Arduino 板发送 MIDI 数据
- react-native - 在 React Native 中单击 TextInput 时切换视图
- repast-simphony - 您如何在自己的服务器上运行 Repast 浏览器模型?