无法在JitPack上发布Android库项目

use*_*162 5 android gradle jitpack

我为Android制作了一个小型库,并将其上传到我的公共Github存储库中。该库项目还包含一个示例应用程序。为了启用在JitPack上的构建,我遵循JitPack自己的说明。

现在,我尝试使用JitPack远程构建它,我得到以下错误:

WARNING:
Gradle 'install' task not found. Please add the 'maven' or 'android-maven' plugin.
See the documentation and examples: https://jitpack.io/docs/

Adding maven plugin
Found android library build file in Library
Running: gradle clean -Pgroup=  -Pversion=v1.2 install
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Djavax.xml.accessExternalSchema=all
Gradle version Gradle 3.1

FAILURE: Build failed with an exception.

* What went wrong:
Task 'clean' not found in root project 'build'.

* Try:
Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 0.532 secs
EXIT_CODE=1
2017-03-22T19:01:33.352614259Z
Exit code: 1
No build artifacts found
Run Code Online (Sandbox Code Playgroud)

这是根构建文件:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
Run Code Online (Sandbox Code Playgroud)

库的构建文件:

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

group=

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 25
    }

}
Run Code Online (Sandbox Code Playgroud)

样本应用程序的构建文件:

apply plugin: 'com.android.application'

buildscript {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }

}

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId 
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"


    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile 'com.android.support:appcompat-v7:25.2.0'

    compile project(':Library')

}
Run Code Online (Sandbox Code Playgroud)

And*_*ejs 5

项目缺少settings.gradle包含库的文件:

include ':Library'
Run Code Online (Sandbox Code Playgroud)

还建议添加 gradle 包装器,以便 JitPack 使用正确的 Gradle 版本构建。

示例项目:https : //github.com/jitpack/android-example