I read about this problem with method limitation 64k and Multi-dex flag. Set Multi-dex, works for me! But I check my app with https://github.com/google/android-classyshark and it says my app has methods-count: 30925
So how is it possible that I have "java.exe" exited with code 2 error? Any ideas?
From the doc
When your app and the libraries it references exceed 65,536 methods, you encounter a build error that indicates your app has reached the limit of the Android build architecture
I have read somewhere that,
App Compat contains ~16k methods
Google Play Services GCM contains ~17k methods
Here, you might be using libraries that might be using other libraries. So you might want to try other tools to check actual method counts.