"Android Gradle plugin requires Java 11 to run" 在发布 jitpack 库时
"Android Gradle plugin requires Java 11 to run" While publishing jitpack library
我正在尝试使用 this github repo
发布一个空的 jitpack 库用于测试目的
但我有
* What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
> 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`.
完全错误:https://jitpack.io/com/github/emreakcan/android-lib-jitpack-test/2.0.0/build.log
我的 IDE 设置为版本 11,
Java 我的 mac.
甚至没有安装 1.8
emre@Emres-MacBook-Pro / % java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment OpenLogic-OpenJDK (build 11.0.8+10-adhoc.admin.jdk11u)
OpenJDK 64-Bit Server VM OpenLogic-OpenJDK (build 11.0.8+10-adhoc.admin.jdk11u, mixed mode)
emre@Emres-MacBook-Pro / %
如果我加
org.gradle.java.home=/Library/Java/JavaVirtualMachines/openlogic-openjdk-11.jdk/Contents/Home
我遇到以下错误
* What went wrong:
Value '/Library/Java/JavaVirtualMachines/openlogic-openjdk-11.jdk/Contents/Home' given for org.gradle.java.home Gradle property is invalid (Java home supplied is invalid)
我的gradle也设置为11
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}
我尝试了这些链接
项目在我的本地工作,当我推送我的标签时,我在 jitpack 网站上遇到了这些错误
通过使用 jitpack.yml
解决(将其添加到项目根目录),结果 jitpack 默认使用 1.8 并且不关心你在 gradle 上设置的内容。
# configuration file for building snapshots and releases with jitpack.io
jdk:
- openjdk11
before_install:
- ./scripts/prepareJitpackEnvironment.sh
我正在尝试使用 this github repo
发布一个空的 jitpack 库用于测试目的但我有
* What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
> 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`.
完全错误:https://jitpack.io/com/github/emreakcan/android-lib-jitpack-test/2.0.0/build.log
我的 IDE 设置为版本 11, Java 我的 mac.
甚至没有安装 1.8emre@Emres-MacBook-Pro / % java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment OpenLogic-OpenJDK (build 11.0.8+10-adhoc.admin.jdk11u)
OpenJDK 64-Bit Server VM OpenLogic-OpenJDK (build 11.0.8+10-adhoc.admin.jdk11u, mixed mode)
emre@Emres-MacBook-Pro / %
如果我加
org.gradle.java.home=/Library/Java/JavaVirtualMachines/openlogic-openjdk-11.jdk/Contents/Home
我遇到以下错误
* What went wrong:
Value '/Library/Java/JavaVirtualMachines/openlogic-openjdk-11.jdk/Contents/Home' given for org.gradle.java.home Gradle property is invalid (Java home supplied is invalid)
我的gradle也设置为11
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}
我尝试了这些链接
项目在我的本地工作,当我推送我的标签时,我在 jitpack 网站上遇到了这些错误
通过使用 jitpack.yml
解决(将其添加到项目根目录),结果 jitpack 默认使用 1.8 并且不关心你在 gradle 上设置的内容。
# configuration file for building snapshots and releases with jitpack.io
jdk:
- openjdk11
before_install:
- ./scripts/prepareJitpackEnvironment.sh