N P
N P

Reputation: 195

Android Studio Build signed App Error

When I try to create signed APK from My Android Studio I get this error:

:app:dexRelease
AGPBI: {"kind":"simple","text":"UNEXPECTED TOP-LEVEL ERROR:","sources":[{}]}
AGPBI: {"kind":"simple","text":"java.lang.OutOfMemoryError: GC overhead limit exceeded","sources":[{}]}

Upvotes: 2

Views: 1251

Answers (2)

ayac3j
ayac3j

Reputation: 81

I have the same error

build.gradle

defaultConfig {

    multiDexEnabled true
}

in your Application

 @Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    //for multiDex  64k
    MultiDex.install(this);
}


add proguard

#suppresses "Ignoring InnerClasses attribute for an anonymous inner class" warning
-keepattributes EnclosingMethod

if has , and you need

dexOptions {
    incremental true
    javaMaxHeapSize "4g"
}

Upvotes: 0

rakesh kashyap
rakesh kashyap

Reputation: 1466

With the limited information you have provided what I can assume is that you area facing OOM exception when building. you can use

dexOptions {
    incremental true
    javaMaxHeapSize "4g"
}

in your app gradle file. This should be inside your android {//blah blah }

Give this a shot. Cheers!!!

Upvotes: 4

Related Questions