Java finished with non-zero exit value 2 - Android Gradle

前端 未结 23 2717
甜味超标
甜味超标 2020-11-22 02:54

I\'m getting this error executing my Android app (I cleaned it and then built it, but the error is still present)

  • Sync: OK
  • Make Project: OK
23条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-22 03:05

    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

提交回复
热议问题