【发布时间】:2021-12-04 11:03:39
【问题描述】:
我似乎无法理解为什么 JitPack 无法构建我的 library,当我检查构建 log 时,我发现了这些错误和警告:
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.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
WARNING:
Gradle 'install' task not found. Please add the 'maven' or 'android-maven' plugin.
我尝试按照 StackOverflow answer 中的建议解决 Java 版本错误,但它没有做任何事情。
我做错了什么,我该如何解决?
【问题讨论】:
-
你需要告诉 Jitpack 使用哪个 Java 版本,另见stackoverflow.com/q/68609683/534471
-
@EmanuelMoecklin 感谢java版本错误似乎已经修复,但现在它抱怨
Failed to apply plugin 'com.github.dcendents.android-maven'.log -
我没有看到你配置 maven 插件,甚至没有使用它。如果没有 maven 插件/配置,Jitpack 无法发布某些内容(另请参阅 jitpack.io/docs/ANDROID)。也许我的文章有帮助:medium.com/nerd-for-tech/…(虽然你可以跳过很多,只做 maven 插件配置部分)。
-
真正重要的部分是:developer.android.com/studio/build/maven-publish-plugin。如果你有这个,Jitpack 将能够构建和发布。
-
对不起,我真的很困惑,我该如何配置 maven 插件?我只是尝试将
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'添加到我的根build.gradle,但它没有改变任何东西。这是我第一次发布库,任何帮助都会很棒。
标签: android android-studio android-library jitpack