I added Google play services to my project for maps but now keep getting this error "java.exe" exited with code 2. I am not sure if it is different from "java.exe" exited with code 1 but I have tried all the suggestions online My heap size is 1G. My target version is 21, I have clean rebuild etc.. When I click on the error it takes me to this CompileToDalvik. How can I resolve this? Even if I remove google play services I still get this error( clean / refresh rebuild etc..)
Using Visual Studio and Xamarin I got this error because I had a wrong path for the Keystore in the .csproj file, and for some reason this path did not get updated while changing the path for the Keystore in the Visual Studio GUI. Manual correcting the path in the .csproj file solved it for me.
We had similar issues and nailed it down to our app going over 64k (65,536) methods limit which could be what's happening when you reference google play services.
Enabling multidex resolved our issue so may be worth trying.
Google Multi-Dex Reference: http://developer.android.com/tools/building/multidex.html
None of the others answers worked for me. What worked for me (but I don't know why) was to empty my bin and obj directories before doing a rebuild.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With