Android Studio错误"Java堆空间"

Android Studio错误

问题描述:

我正在Android Studio中开发一个Android应用程序,今天突然按下运行"按钮时,它无法编译.错误是这样的:

I'm developing an Android app in Android Studio and today suddenly it doesn't compile when I press the "Run" button. The error is this:

错误:任务执行失败 ':app:packageInstantRunResourcesDebug'. Java堆空间

Error:Execution failed for task ':app:packageInstantRunResourcesDebug'. Java heap space

我尝试清理项目并重建它,但是没有用.

I've tried cleaning the project and rebuilding it but it didn't work.

我尝试了许多解决方案,但最终,这帮助我解决了这个问题:-

I have tried many solutions but finally, this helped me to solve this problem : -

distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

在"gradle-wrapper.properties"中使用此行.希望它对其他人也有帮助.

use this line in your "gradle-wrapper.properties". hope it helps others too.