instant run java.lang.OutOfMemoryError: GC overhead limit exceeded

前端 未结 4 1433
刺人心
刺人心 2020-12-14 19:54

I have upgraded to Android Studio 2.1 and I got this error while I am trying to build & run my corporate big project:

Execution failed for task \

4条回答
  •  佛祖请我去吃肉
    2020-12-14 20:42

    Step1: Change build.grade

    defaultConfig {
            ...
            // Enabling multidex support.
            multiDexEnabled true
           }
    
    dependencies {
            ...
            compile 'com.android.support:multidex:1.0.0'
        }
    

    Step2: Setting on the Application class

    public class MyApplication extends Application {
    
    @Override
    public void onCreate() {
        super.onCreate();
        MultiDex.install(this);
    }
    
    }
    

    Step3: Change grade.properties

    org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
    

    It will work!. Thanks.

提交回复
热议问题