Error generating a signed APK

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 two (2) errors:

  

Error: The number of method references in a .dex file can not exceed 64K.   Learn how to resolve this issue at link

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?

    
asked by anonymous 02.09.2016 / 22:22

1 answer

2

Go to your build.gradle file (inside the / app folder)

and in your defaultConfig, add this line:

multiDexEnabled true

It will look like this:

defaultConfig {
        applicationId "br.com.package.example"
        minSdkVersion 14
        targetSdkVersion 24
        versionCode 1
        versionName "1.0.0"
        multiDexEnabled true
    }
    
02.09.2016 / 22:31