新建项目报错
提示:新建项目报错
Failed to apply plugin 'com.android.internal.application':
问题描述
新建项目gradle版本是7.0 的时候运行项目报错
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`.
原因分析:
提示:应该是gradle版本太高了,需要使用Android studio自带的Java11,才能运行
解决方案:
1.选择工具:project structure
2.点击gradle setting
选择Gradle JDK
4.使用Android Studio 自带的11版本
然后运行项目吧,解决了!
来源地址:https://blog.csdn.net/weixin_43797914/article/details/127518996