简体   繁体   中英

How to fix "ERROR: Could not get unknown property 'assembleRelease' for FileBasedMavenArtifact_Decorated aar"

I want to build my lib with aar file. After upgrading to the latest android gradle plugin 3.4.2 I am getting this error: ERROR: Could not get unknown property 'assembleRelease' for FileBasedMavenArtifact_Decorated aar:null of type org.gradle.api.publish.maven.internal.artifact.FileBasedMavenArtifact. How to fix that one inside publishing section?

I have tried changing builtBy assembleRelease into builtBy 'assembleRelease' but in that case I loose assembleRelease from my tasks in gradle.

    publications {
        Production(MavenPublication) {
        artifact("$buildDir/outputs/aar/${archivesBaseName}-       {$versions.versionName}.aar") {
                builtBy assembleRelease
            }

Change your code like this

builtBy tasks.getByName('assembleRelease')

and this is work for me

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM