[英]Android Studio - 'com.android.internal.application' Java 11 - fix gradle projects not visibile in Android studio
I have the issue我有问题
Error: Android Gradle plugin requires Java 11 to run.错误:Android Gradle 插件需要 Java 11 才能运行。 You are currently using Java 1.8.
您当前使用的是 Java 1.8。 -& Failed to apply plugin 'com.android.internal.application'
-& 未能应用插件'com.android.internal.application'
Error: Android Gradle plugin requires Java 11 to run. 错误:Android Gradle 插件需要 Java 11 才能运行。 You are currently using Java 1.8.
您当前使用的是 Java 1.8。 -& Failed to apply plugin 'com.android.internal.application'
-& 未能应用插件'com.android.internal.application'
The solution requires to download JDK 11.0, then change gradle projects - the option is not available in Android studio.该解决方案需要下载JDK 11.0,然后更改gradle项目 - 该选项在Android studio中不可用。 Do I need to upgrade android studion or change the setups?
我是否需要升级 android studion 或更改设置?
No, you do not need to do anything that complex.不,您不需要做任何复杂的事情。 First, download OpenJDK 11 from here .
首先,从这里下载 OpenJDK 11。 Extract the contents of the zip in a folder.
将 zip 的内容解压缩到一个文件夹中。 Then, find the
gradle.properties
file in your android project (Create one if it's not there).然后,在您的 android 项目中找到
gradle.properties
文件(如果不存在则创建一个)。 Then.然后。 add this property to it:
将此属性添加到它:
org.gradle.java.home=path/to/jdk11
Note: Do not point towards the bin folder, just point towards the home JDK 11 directory.注意:不要指向 bin 文件夹,只需指向 JDK 11 主目录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.