com.android.build.transform.api.TransformException

后端 未结 25 2040
独厮守ぢ
独厮守ぢ 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    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.

提交回复
热议问题