Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Configuration with name 'releaseApiElements' not found #247

Closed
gigaga opened this issue Nov 8, 2018 · 2 comments
Closed

Configuration with name 'releaseApiElements' not found #247

gigaga opened this issue Nov 8, 2018 · 2 comments

Comments

@gigaga
Copy link

gigaga commented Nov 8, 2018

Hi support,

When I try to upload my package to Bintray with
./gradlew clean build bintrayUpload -PbintrayUser=<user> -PbintrayKey=<key>
I have the following error:
Configuration with name 'releaseApiElements' not found

Do you have some explanations / solutions / workaround?

publishing {
    repositories {
        maven {
            url System.env.SDK_MAVEN_SERVER_WRITE_URL
            credentials(HttpHeaderCredentials) {
                name = "Authorization"
                value = "Basic ${System.env.SDK_MAVEN_SERVER_TOKEN}"
            }
            authentication {
                header(HttpHeaderAuthentication)
            }
        }
    }
    publications {

        android.libraryVariants.all { variant ->

			// Publishing only release buildType
            if (variant.buildType.name == "release") {
                "maven${variant.name.capitalize()}Aar"(MavenPublication) {
                    from components.findByName("android${variant.name.capitalize()}")
                    groupId project.ext.groupId
                    artifactId project.ext.artifactId
                    version "${android.defaultConfig.versionName}-${variant.getFlavorName()}"
                }
            }
        }
    }
}

publish {
    userOrg = '<user>'
    groupId = project.ext.groupId
    artifactId = project.ext.artifactId
    publishVersion = "${android.defaultConfig.versionName}"
    desc = 'Oh hi, this is a nice description for a project, right?'
    website = 'https://github.com/novoda/bintray-release'
	publications = ['mavenProdReleaseAar']
}

Best regards

@mr-archano
Copy link
Contributor

Hi @gigaga what version of the plugin are you using? What version of Gradle?

It sounds like you are trying to publish an Android library as Java library (apiElements is not available as configuration in the Android project model, just in projects that are using the java gradle plugin).

Also the line below looks wrong:

from components.findByName("android${variant.name.capitalize()}")

There is no software component generated by the Android Gradle Plugin, so the bintray-release plugin is attempting to provide one (and this led to the dependency on an internal Gradle API as captured by #177, and is currently being worked on)

@gigaga
Copy link
Author

gigaga commented Nov 8, 2018

Hi @mr-archano. Thanks for your comment. In fact, if I remove the whole of bintray-release references and I conserve only the publications used by android-maven-publish plugin, it works.

Furthermore, if I replace your plugin by gradle-bintray-plugin, it works too.

Best regards

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

No branches or pull requests

2 participants