wupdigital / android-maven-publish

Modification of the standard Maven Publish plugin to be compatible with android-library projects (aar).
Apache License 2.0
326 stars 39 forks source link

Not working with Gradle 4.2 #3

Closed bernatpl closed 7 years ago

bernatpl commented 7 years ago

Not working with Gradle 4.2.

FAILURE: No such property: FOR_COMPILE for class: org.gradle.api.attributes.Usage

(Using android-maven-publish version 2.0.0)

warnyul commented 7 years ago

Try 3.0.0-SNAPSHOT version. This version supports 4.x Gradle versions.

mannodermaus commented 7 years ago

This seems to be unrelated to the previous issues with Gradle 4.x, since I'm also facing a similar issue when updating Gradle to either 4.2 or 4.2.1 and using the plugin's latest SNAPSHOT:

> Exception thrown while executing model rule: PublishingPlugin.Rules#publishing(ExtensionContainer)
   > No such property: FOR_RUNTIME for class: org.gradle.api.attributes.Usage

(...)
Caused by: groovy.lang.MissingPropertyException: No such property: FOR_RUNTIME for class: org.gradle.api.attributes.Usage
    at digital.wup.android_maven_publish.AndroidVariantLibrary$RuntimeUsage.getUsage(AndroidVariantLibrary.groovy:93)

The constants FOR_COMPILE and FOR_RUNTIME have been removed in Gradle 4.2 (compare the Javadocs for 4.1 and 4.2). This commit is responsible for the change, and gives more insight into the reasoning behind the removal.

bernatpl commented 7 years ago

It seems to be working in version 3.1.0-SNAPSHOT using Gradle 4.2 and 4.2.1 Thank you for the fix.

warnyul commented 7 years ago

Thanks for your response. I will make a release at weekend.

mannodermaus commented 7 years ago

Using the latest SNAPSHOT works for me as well. Thank you for the quick response! Looking forward to the release.