我能';t使用maven发布插件发布android库

我能';t使用maven发布插件发布android库,android,maven,gradle,android-gradle-plugin,gradle-plugin,Android,Maven,Gradle,Android Gradle Plugin,Gradle Plugin,我有一个安卓项目在这个项目里面我有一个安卓模块。我试图发布一个maven工件,但我收到了下一条消息,指定了发布,但项目中不存在发布: 我的项目build.gradle是下一个: // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = "1.3.72" repositor

我有一个安卓项目在这个项目里面我有一个安卓模块。我试图发布一个maven工件,但我收到了下一条消息,指定了发布,但项目中不存在发布:

我的项目build.gradle是下一个:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    ext.kotlin_version = "1.3.72"
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.0"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

plugins {
    id "com.jfrog.bintray" version "1.8.5"
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'maven-publish'

android {
    compileSdkVersion 29
    buildToolsVersion "30.0.0"

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

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

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.3.0'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7'
}

afterEvaluate {
    publishing {
        publications {
            // Creates a Maven publication called "release".
            release(MavenPublication) {
                // Applies the component for the release build variant.
                from components.release

                // You can then customize attributes of the publication as shown below.
                groupId = 'io.github.rockbass2560'
                artifactId = 'imageprogress'
                version = '1.0.0'
            }
        }
    }
}

def localProperties = new Properties()
localProperties.load(new FileInputStream(rootProject.file("local.properties")))

bintray {
    user = localProperties.getProperty("bintray.user")
    key = localProperties.getProperty("bintray.apikey")
    publications = ['release']
    pkg {
        repo = 'imageprogress'
        name = 'imageprogress'
        userOrg = user
        licenses = ['Apache-2.0']
        vcsUrl = 'https://github.com/rockbass2560/ImageProgress.git'
        version {
            name = '1.0-Final'
            desc = 'First version for ImageProgress plugin'
            released  = new Date()
            vcsTag = '1.0.0'
            attributes = ['version': '1','released':true]
        }
    }
}
我的gradle模块是下一个:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    ext.kotlin_version = "1.3.72"
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.0"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

plugins {
    id "com.jfrog.bintray" version "1.8.5"
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'maven-publish'

android {
    compileSdkVersion 29
    buildToolsVersion "30.0.0"

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

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

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.3.0'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7'
}

afterEvaluate {
    publishing {
        publications {
            // Creates a Maven publication called "release".
            release(MavenPublication) {
                // Applies the component for the release build variant.
                from components.release

                // You can then customize attributes of the publication as shown below.
                groupId = 'io.github.rockbass2560'
                artifactId = 'imageprogress'
                version = '1.0.0'
            }
        }
    }
}

def localProperties = new Properties()
localProperties.load(new FileInputStream(rootProject.file("local.properties")))

bintray {
    user = localProperties.getProperty("bintray.user")
    key = localProperties.getProperty("bintray.apikey")
    publications = ['release']
    pkg {
        repo = 'imageprogress'
        name = 'imageprogress'
        userOrg = user
        licenses = ['Apache-2.0']
        vcsUrl = 'https://github.com/rockbass2560/ImageProgress.git'
        version {
            name = '1.0-Final'
            desc = 'First version for ImageProgress plugin'
            released  = new Date()
            vcsTag = '1.0.0'
            attributes = ['version': '1','released':true]
        }
    }
}

我已经在android页面和其他页面上制作了教程,但我无法修复该问题。

尝试删除
afterEvaluate{..
container我从中得到的示例我再次尝试并解决了它,它不需要重大修改,我只是将出版物的名称更改为imageprogress in publications tag and publications section in bintray,之后我运行了下一个任务:gradle publish binaryUpload