我在尝试以调试模式运行构建时收到此消息
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
> java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
在再次启动应用程序之前,我已经运行了
flutter clean
然后 flutter pub get
。还是不行啊!
flutter doctor
命令结果也很好
通过将此行添加到 gradle.properties 来尝试此解决方案。
org.gradle.jvmargs=-Xmx4608m
终于成功了! 我通过在gradle.properties文件中添加添加
org.gradle.jvmargs=-Xmx4608m
并直接删除./gradle/cahes解决了这个问题✔️
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
> java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $