Загрузить библиотеку Android в JitPack.io
Я сделал библиотеку Android и загрузил на Github. ( https://github.com/ABPSoft/ABPUiHelper)
Теперь я хочу добавить в jitpack.io. Но я получаю ошибку!
Как я могу загрузить на jitpack.io?
Вот мой журнал ошибок:
Build starting...
Start: Sat Oct 6 15:28:13 UTC 2018 d3
Git:
1.2.7-0-gbcf82d4
commit bcf82d4747110e8763af9d2d6abfb649a0e9cea7
Merge: 0a31b6e 8627f85
Author: Amin Bahrami
Date: Sat Oct 6 18:57:09 2018 +0330
Merge branch 'master' of https://github.com/ABPSoft/ABPUiHelper
Run gradle build
Gradle build script
ERROR: Gradle wrapper not found. Please add. Using default gradle to build.
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Djavax.xml.accessExternalSchema=all -Dhttps.protocols=TLSv1.2
Welcome to Gradle 4.8.1!
Here are the highlights of this release:
- Dependency locking
- Maven Publish and Ivy Publish plugins improved and marked stable
- Incremental annotation processing enhancements
- APIs to configure tasks at creation time
For more details see https://docs.gradle.org/4.8.1/release-notes.html
------------------------------------------------------------
Gradle 4.8.1
------------------------------------------------------------
Build time: 2018-06-21 07:53:06 UTC
Revision: 0abdea078047b12df42e7750ccba34d69b516a22
Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM: 1.8.0_181 (Oracle Corporation 25.181-b13)
OS: Linux 4.14.15-xxxx-std-ipv6-64 amd64
0m0.743s
Getting tasks: gradle tasks --all
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Djavax.xml.accessExternalSchema=all -Dhttps.protocols=TLSv1.2
FAILURE: Build failed with an exception.
* Where:
Build file '/home/jitpack/build/build.gradle' line: 1
* What went wrong:
A problem occurred evaluating root project 'build'.
> Plugin with id 'com.github.dcendents.android-maven' not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
WARNING:
Gradle 'install' task not found. Please add the 'maven' or 'android-maven' plugin.
See the documentation and examples: https://jitpack.io/docs/
Looking for android-library
Looking for com.android.application
Adding maven plugin
Running: gradle clean -Pgroup=com.github.ABPSoft -Pversion=1.2.7 install
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Djavax.xml.accessExternalSchema=all -Dhttps.protocols=TLSv1.2
FAILURE: Build failed with an exception.
* Where:
Build file '/home/jitpack/build/build.gradle' line: 1
* What went wrong:
A problem occurred evaluating root project 'build'.
> Plugin with id 'com.github.dcendents.android-maven' not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
EXIT_CODE=1
2018-10-06T15:28:16.88044162Z
Exit code: 1
No build artifacts found
Спасибо
1 ответ
Ошибка произошла из-за неправильной структуры вашего проекта. Ваш текущий проект содержит только библиотечную часть. Он также должен содержать корневые файлы проекта, такие как эта структура:
ABPUiHelper
- gradle
- YourLibraryModule
- build.gradle
- gradle.properties
- gradlew
- local.properties
- settings.gradle
Затем из журнала ошибок вы можете увидеть, что jitpack.io не может найти нужный плагин:
* What went wrong:
A problem occurred evaluating root project 'build'.
> Plugin with id 'com.github.dcendents.android-maven' not found.
Итак, убедитесь, что у вас есть плагин в вашем корне build.gradle
как следующее:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
// This should be exist
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}
...