【发布时间】:2022-06-17 15:20:03
【问题描述】:
我在构建中将sourceCompatibility 和targetCompatibility 更改为JavaVersion.VERSION_11。所有模块的 gradle 文件。在我的电脑中,我有 JDK 11,JAVA_HOME 和路径都可以,在项目中:
但我仍然得到
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.homeingradle.properties`
我的 gradle.properties:
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 org.gradle.parallel=true android.useAndroidX=true android.enableJetifier=true
【问题讨论】:
-
@Manohar,我已阅读此主题。我有健全的设置。但是还是会出现这个错误
-
更改路径变量后尝试重启系统。
标签: android gradle android-gradle-plugin