无法将 android 库上传到 JitPack.io。无法应用插件 [id 'com.android.internal.version-check']
Not able to upload android library to JitPack.io. Failed to apply plugin [id 'com.android.internal.version-check']
我制作了一个 android 库并上传到 Github。 (https://github.com/Shekhar23/TxtLogSdk)
现在我想添加到 jitpack.io。但是我得到一个错误!
如何上传到 jitpack.io?
构建日志:https://jitpack.io/com/github/Shekhar23/TxtLogSdk/2.1/build.log
评估项目“:app”时出现问题。
Failed to apply plugin [id 'com.android.internal.version-check']
Minimum supported Gradle version is 6.1.1. Current version is 4.8.1. If using the gradle wrapper, try editing the distributionUrl in /home/jitpack/build/gradle/wrapper/gradle-wrapper.properties to gradle-6.1.1-all.zip
您更新 Gradle 文件了吗?
您应该有类似于以下配置的内容:
settings.gradle
include ':app', ':NAME_OF_LIBRARY'
rootProject.name = "NAME_OF_LIBRARY"
build.gradle(模块)
添加插件、组和版本
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
group = 'com.github.YOURGITHUBNAME'
version = rootProject.ext.versionName
...
build.gradle(项目)
将 github 类路径添加到您的依赖项
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}
allprojects {
repositories {
google()
jcenter()
...
}
}
ext {
compileSdkVersion = 29
buildToolsVersion = '29.0.2'
versionName = '1.0.0'
...
}
task clean(type: Delete) {
delete rootProject.buildDir
}
最初我在 Gradle 4.8.1 中也遇到了这个错误,这肯定令人困惑:
Found gradle
Gradle build script
WARNING: gradle/wrapper/gradle-wrapper.jar does not exist! Needs to be committed.
ERROR: Gradle wrapper not found. Please add. Using default gradle to build.
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Welcome to Gradle 4.8.1!
详情见build.log。
我真正错过的是将 ./gradlew
和 ./gradle/wrapper/gradle-wrapper.jar
包含到 git 存储库中。 是的!您应该将这些文件上传到 github!
之后就可以使用最新的gradle版本了,太棒了!
这是构建日志:
Found gradle
Gradle build script
Found gradle version: 6.5.
Using gradle wrapper
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Downloading https://services.gradle.org/distributions/gradle-6.5-all.zip
...
------------------------------------------------------------
Gradle 6.5
详情见build.log。
- 其实这个信息在官方手册https://jitpack.io/docs/ANDROID/中,但是上传的要求gradle-files描述的不是很清楚
- 这个问题的评论很有帮助:https://github.com/jitpack/jitpack.io/issues/2311
P.S。插件 com.github.dcendents.android-maven
应包含在两个 build.gradle
文件中,如手册中所述。
我制作了一个 android 库并上传到 Github。 (https://github.com/Shekhar23/TxtLogSdk)
现在我想添加到 jitpack.io。但是我得到一个错误!
如何上传到 jitpack.io?
构建日志:https://jitpack.io/com/github/Shekhar23/TxtLogSdk/2.1/build.log
评估项目“:app”时出现问题。
Failed to apply plugin [id 'com.android.internal.version-check'] Minimum supported Gradle version is 6.1.1. Current version is 4.8.1. If using the gradle wrapper, try editing the distributionUrl in /home/jitpack/build/gradle/wrapper/gradle-wrapper.properties to gradle-6.1.1-all.zip
您更新 Gradle 文件了吗?
您应该有类似于以下配置的内容:
settings.gradle
include ':app', ':NAME_OF_LIBRARY'
rootProject.name = "NAME_OF_LIBRARY"
build.gradle(模块)
添加插件、组和版本
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
group = 'com.github.YOURGITHUBNAME'
version = rootProject.ext.versionName
...
build.gradle(项目)
将 github 类路径添加到您的依赖项
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}
allprojects {
repositories {
google()
jcenter()
...
}
}
ext {
compileSdkVersion = 29
buildToolsVersion = '29.0.2'
versionName = '1.0.0'
...
}
task clean(type: Delete) {
delete rootProject.buildDir
}
最初我在 Gradle 4.8.1 中也遇到了这个错误,这肯定令人困惑:
Found gradle
Gradle build script
WARNING: gradle/wrapper/gradle-wrapper.jar does not exist! Needs to be committed.
ERROR: Gradle wrapper not found. Please add. Using default gradle to build.
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Welcome to Gradle 4.8.1!
详情见build.log。
我真正错过的是将 ./gradlew
和 ./gradle/wrapper/gradle-wrapper.jar
包含到 git 存储库中。 是的!您应该将这些文件上传到 github!
之后就可以使用最新的gradle版本了,太棒了! 这是构建日志:
Found gradle
Gradle build script
Found gradle version: 6.5.
Using gradle wrapper
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Downloading https://services.gradle.org/distributions/gradle-6.5-all.zip
...
------------------------------------------------------------
Gradle 6.5
详情见build.log。
- 其实这个信息在官方手册https://jitpack.io/docs/ANDROID/中,但是上传的要求gradle-files描述的不是很清楚
- 这个问题的评论很有帮助:https://github.com/jitpack/jitpack.io/issues/2311
P.S。插件 com.github.dcendents.android-maven
应包含在两个 build.gradle
文件中,如手册中所述。