com.android.build.transform.api.TransformException

后端 未结 25 2369
独厮守ぢ
独厮守ぢ 2020-11-22 06:14

I am trying to integrate Google sign in, in my app, I added these libraries:

compile \'com.google.android.gms:play-services-identity:8.1.0\'
compile \'com.go         


        
25条回答
  •  无人共我
    2020-11-22 06:55

    I resolved it with the next:

    I configured multidex

    In build.gradle you need to add the next one.

    android {
    ...
       defaultConfig {
           ...
           // Enabling multidex support.
           multiDexEnabled true
           ...
       }
       dexOptions {
          incremental true
          maxProcessCount 4 // this is the default value
          javaMaxHeapSize "2g"
       }
    ...
    }
    dependencies {
    ...
       compile 'com.android.support:multidex:1.0.1'
    ...
    }
    

    Add the next one in local.properties

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

    After that into Application class you need to add the Multidex too.

     public class MyApplication extends MultiDexApplication {
    
       @Override
       public void onCreate() {
           super.onCreate();
           //mas codigo
       }
    
       @Override
       protected void attachBaseContext(Context base) {
           super.attachBaseContext(base);
           MultiDex.install(this);
       }
    }
    

    Don't forget add the line code into Manifest.xml

    
    

    That's it with this was enough for resolve the bug: Execution failed for task ':app:transformClassesWithDexForDebug. Check very well into build.gradle with javaMaxHeapSize "2g" and the local.properties org.gradle.jvmargs=-Xmx2048m are of 2 gigabyte.

提交回复
热议问题