大致错误如下:
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.
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`.
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Android Gradle插件需要Java 11才能运行。您当前正在使用Java 1.8(或者其它版本),其实就是JDK版本不匹配,只要设置对应的JDK版本即可。
按照下图的顺序操作设置即可: