I have a small Android application that is failing to compile from command line. I can build and deploy the application to the emulator in Android Studio without issues, however when I try to build from the command line I get the error below.
gradle clean assembleDebug FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:transformClassesWithDexForRelease'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
I understand it's saying I've exceeded the Android 64k method limit described here:
https://developer.android.com/studio/build/multidex.html
However why would the application compile fine in Android Studio? Any idea what I'm doing wrong when compiling from the command line? Thanks in advance.