I\'m getting this error executing my Android app (I cleaned it and then built it, but the error is still present)
I Reject Embedded JDK ( in 32bit ) because embedded JDK is 64bit
Right click your Project -> Open Module Setting -> SDK Location -> Uncheck Use embedded JDk then set your JDK Path, eg in Ubuntu /usr/lib/jvm/java-8-openjdk-i386
For me i was adding the whole playstore dependencies
compile 'com.google.android.gms:play-services:8.4.0'
But i needed google map only , so i made it more specific and the error was resolved.
compile 'com.google.android.gms:play-services-maps:8.4.0'
If you want to see what exactly is causing the error, try building your project via gradle terminal, like this ./gradlew assembleDebug --stacktrace --debug
. I've seen the following error in my case com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
This happened when I was trying to entegrate Google Maps to my project. To fix it, I simply checked libraries I was including
compile 'com.google.android.gms:play-services:9.8.0'
I simply changed it to
compile 'com.google.android.gms:play-services-maps:9.8.0'
and problem was gone
Possible problem: You have exceeded dex 65k methods limit, may be you added some library or several methods before problem occurred?
I didn't know (by then) that "compile fileTree(dir: 'libs', include: ['*.jar'])" compile all that has jar extension on libs folder, so i just comment (or delete) this lines:
//compile 'com.squareup.retrofit:retrofit:1.9.0'
//compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
//compile 'com.squareup.okhttp:okhttp:2.2.0'
//compile files('libs/spotify-web-api-android-master-0.1.0.jar')
//compile files('libs/okio-1.3.0.jar')
and it works fine. Thanks anyway! My bad.
I think it's conflicts of .jar file in your project.
I have removed android-support-v4.jar from libs folder and its working !!!
if your project gives error, check in your build.gradle file
dependencies {
}