执行 com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction 时发生故障

问题描述 投票:0回答:3

我在尝试以调试模式运行构建时收到此消息

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
命令结果也很好

flutter dart gradle exception
3个回答
4
投票

通过将此行添加到 gradle.properties 来尝试此解决方案。

org.gradle.jvmargs=-Xmx4608m

1
投票

终于成功了! 我通过在gradle.properties文件中添加添加

org.gradle.jvmargs=-Xmx4608m
并直接删除./gradle/cahes解决了这个问题✔️


0
投票

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 $

© www.soinside.com 2019 - 2024. All rights reserved.