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

前端 未结 23 2707
甜味超标
甜味超标 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:01

    I had the same error after converting my project to Kotlin. My problem was that my jre location was changed to an invalid path during the process (I wonder why this could happen... made me waste time). Fixed it by doing this:

    File > Project Structure > SDK Location 
    

    Unchecked the Use embedded JDK option, which was pointing to an old JDK installation, and selected the correct one:

    /home/my_user/jdk1.8.0_101
    

    After changing this, the error disappeared

提交回复
热议问题