Error generating signed APK

Asked

Viewed 295 times

0

So, I’m developing an app where I want to use Google Maps, but when I try to generate the signed APK I get 2 (two) errors:

Error:The number of method References in a . Dex file cannot exceed 64K. Learn how to resolve this Issue at https://developer.android.com/tools/building/multidex.html

and

Error:Execution failed for task ':app:transformClassesWithDexForRelease'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C: Program Files Java jdk1.8.0_101 bin java.exe'' finished with non-zero Exit value 2 :app:transformClassesWithDexForRelease FAILED

What can it be? And what is the possible solution?

  • 1

    It seems to me that the second mistake is a consequence of the first.. Your project is too big, for this you should add multidex (do not recommend because your application loses performance, try to remove unused Biblotecas).. You could show your build.Radle, the dependencies your project uses?

1 answer

2


Goes in your build.Radle file (inside the /app folder)

and in your defaultConfig, add this line:

multiDexEnabled true

It’ll stay that way:

defaultConfig {
        applicationId "br.com.package.example"
        minSdkVersion 14
        targetSdkVersion 24
        versionCode 1
        versionName "1.0.0"
        multiDexEnabled true
    }
  • +1 already happened to me and I resolved this way.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.