4

Error while generating release bundle with minifyEnabled true option. Here are the Gradle settings which give me the error:

buildTypes { release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } 

I also see that task transformClassesAndResourcesWithR8For... takes too much time (up to 10-20 mins)

The error: java.lang.OutOfMemoryError: GC overhead limit exceeded in Gradle task transformClassesAndResourcesWithR8ForCommonRelease

1

1 Answer 1

5

Instead of turning of R8 a solution will be to raise the JVM heap size for the gradle daemon by adding/changing the value of org.gradle.jvmargs in gradle.properties (in the root of the Adroid Studio project):

 org.gradle.jvmargs=-Xmx2G 

If that is not enough try going to 4G. The memory use of R8 have been growing, and for 3.4 there has been OOM issues on some apps.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.