“java.exe” exited with code 2 Xamarin.Android project

Found the answer after about 20 hours of searching in my project.. So here are the steps to resolve the problem “java.exe” exited with code 2 1) Change the MainDexClasses.bat as described in the link: http://www.jon-douglas.com/2016/09/05/xamarin-android-multidex/ 2) Make sure you have enabled Multidex Option in your Android Application! Have a look at the .csprj file … Read more

Android Studio 3.0 Beta 1: Failed to resolve: com.android.support:multidex:1.0.2

Apparently my issue is I should post this: maven { url ‘https://maven.google.com’ } in allprojects and not in buildscript (the subtle different has blinded me where the issue is), which then looks like this: allprojects { repositories { maven { url ‘https://maven.google.com’ } } } Thanks to M D for the pointers!

Didn’t find class “android.support.multidex.MultiDexApplication” on path: DexPathList

The solution didn’t help me because I was using jetpack version ie androidx. libraries. Followed official doc. And I had to change name to androidx….Multidex. <application android:name=”androidx.multidex.MultiDexApplication” > … </application> Hope It helps other people looking for adding multidex with jetpack.

Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’

Just correct Google play services dependencies: You are including all play services in your project. Only add those you want. For example , if you are using only maps and g+ signin, than change compile ‘com.google.android.gms:play-services:8.1.0’ to compile ‘com.google.android.gms:play-services-maps:8.1.0’ compile ‘com.google.android.gms:play-services-plus:8.1.0’ From the doc : In versions of Google Play services prior to 6.5, you … Read more

How to shrink code – 65k method limit in dex

It looks like Google has finally implementing a workaround/fix for surpassing the 65K method limit of dex files. About the 65K Reference Limit Android application (APK) files contain executable bytecode files in the form of Dalvik Executable (DEX) files, which contain the compiled code used to run your app. The Dalvik Executable specification limits the … Read more