'android-24' requires JDK 1.8 or later to compile

后端 未结 8 2095
轮回少年
轮回少年 2021-02-01 00:12

I use Android Studio and recently got the error:

Error:Execution failed for task \':app:compileDebugJavaWithJavac\'. compileSdkVersion \'android-24\' re

8条回答
  •  情歌与酒
    2021-02-01 00:47

    I installed latest jdk but it was using the older one until I did this:

    app rt-click >> module settings >> sdk location >> (old jdk path)
    

    Replace the old JDK path with your new jdk path.

    Works like a charm now :)

提交回复
热议问题