Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error:groovy.lang.MissingPropertyException: No such property: project for class: digital.wup.android_maven_publish.VariantPublishConfiguration #5

Closed
lsuski opened this issue Oct 30, 2017 · 7 comments
Assignees
Labels
Milestone

Comments

@lsuski
Copy link

lsuski commented Oct 30, 2017

I have this exception when trying to use components.androidDebug or components.androidRelease with Gradle 4.2.1 and AGP 3.0.0

@warnyul warnyul added the bug label Oct 30, 2017
@warnyul warnyul added this to the 3.1.1 milestone Oct 30, 2017
@warnyul warnyul self-assigned this Oct 30, 2017
@magneticflux-
Copy link

@lsuski How did you work around this issue? I came here from dcendents/android-maven-gradle-plugin#64.

@magneticflux-
Copy link

For future reference, I added maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' } to my buildscript repositories and then updated to 3.3.1-SNAPSHOT where the bug is fixed.

@warnyul
Copy link
Contributor

warnyul commented Nov 5, 2017

3.1.1 has been released.

@warnyul warnyul closed this as completed Nov 5, 2017
@lsuski
Copy link
Author

lsuski commented Nov 6, 2017

Having 2 separate publications for debug and release has some drawback - it performs 2 separate uploads to maven repository (for Maven they are separate versions so for SNAPSHOT it increment version counter) but I wanted to have single upload with artifacts: my-lib-debug.aar and my-lib-release.aar.
To workaround this I have this in build.gradle

publishing.publications {
 "mavenAll"(MavenPublication) {
        def addAll=true
        pom.packaging = 'aar'
        android.libraryVariants.all { v ->
            if (addAll) {
                addAll=false
                from components.android // this can be called only once
                setArtifacts([])    //clears artifact added by components.android - my-lib.aar
                artifact(tasks.sourcesJar) //add sources my-lib-sources.jar - optional
            }
            artifact(tasks."bundle${v.name.capitalize()}") {    // add aar artifact my-lib-<variant>.aar
                classifier v.name
            }
        }
    }
}

@magneticflux-
Copy link

@lsuski Unfortunately, that prevents your variants from having different dependencies because Maven can only have one pom.xml file per version per artifact ID. The way Google Guava separates their JVM and Android builds is by appending it to the end of the version: guava:23.3-android or guava:23.3-jvm.

@lsuski
Copy link
Author

lsuski commented Nov 6, 2017

Yeah, I know that but in this case I have the same dependencies.

@magneticflux-
Copy link

@lsuski Okay, I'm just clarifying and bringing up all of the options for any other people looking for a solution here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants