問題
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.application'.
> Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
Your current JDK is located in /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing `org.gradle.java.home` in `gradle.properties`.
在gradle.properties 增加
org.gradle.java.home=/Applications/Android Studio.app/Contents/jre/Contents/Home
以上的路徑要以自己的時機情況作修改
可以在android studio 的 gradle 配置裡可以看到java11的路徑 加進去就好