com.android.build.transform.api.TransformException

后端 未结 25 2032
独厮守ぢ
独厮守ぢ 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:59

    I just had to Clean my project and then it built successfully afterwards.

    0 讨论(0)
  • 2020-11-22 06:59

    In my case the Exception occurred because all google play service extensions are not with same version as follows

     compile 'com.google.android.gms:play-services-plus:9.8.0'
     compile 'com.google.android.gms:play-services-appinvite:9.8.0'
     compile 'com.google.android.gms:play-services-analytics:8.3.0'
    

    It worked when I changed this to

    compile 'com.google.android.gms:play-services-plus:9.8.0'
     compile 'com.google.android.gms:play-services-appinvite:9.8.0'
     compile 'com.google.android.gms:play-services-analytics:9.8.0'
    
    0 讨论(0)
  • 2020-11-22 07:00

    This error began appearing for me when I added some new methods to my project. I knew that I was nowhere near the 65k method limit and did not want to enable multiDex support for my project if I could help it.

    I resolved it by increasing the memory available to the :app:transformClassesForDexForDebug task. I did this by specifying javaMaxHeapSize in gradle.build.

    gradle.build

    android {
        ...
        dexOptions {
            javaMaxHeapSize "4g" //specify the heap size for the dex process
        }
    }
    

    I tried this after having had no success with other common solutions to this problem:

    • Running a project clean
    • Manually deleting the /app/build and /build directories from my project
    • Invalidating Gradle Cache and restarting Android Studio

    Error

    Error:Execution failed for task > ':app:transformClassesWithDexForDebug'. com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

    Note: increasing the memory available to the DEX task can cause performance problems on systems with lower memory - link.

    0 讨论(0)
  • 2020-11-22 07:00

    the write answer is in gradle put defaultConfig { multiDexEnabled true } then application name in manifest android:name="android.support.multidex.MultiDexApplication" wish this answer is hellpful to some one

    0 讨论(0)
  • 2020-11-22 07:01

    If the different dependencies have a same jar also cause this build error.

    For example:

    compile('com.a.b:library1');
    compile('com.c.d:library2');
    

    If "library1" and "library2" has a same jar named xxx.jar, this will make such an error.

    0 讨论(0)
  • 2020-11-22 07:03

    I solved this issue by change to use latest buildToolsVersion

    android {
        //...
        buildToolsVersion '26.0.2' // change from '23.0.2'
        //...
    }
    
    0 讨论(0)
提交回复
热议问题