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

OSS Licences Plugin fails with Gradle 8.8 #299

Open
jakob-grabner opened this issue Jun 20, 2024 · 5 comments
Open

OSS Licences Plugin fails with Gradle 8.8 #299

jakob-grabner opened this issue Jun 20, 2024 · 5 comments

Comments

@jakob-grabner
Copy link

Describe the bug
After updating to Gradle 8.8 the OssLicensesTask fails to resolve module variants.

Execution failed for task ':running:googleDevelopmentReleaseOssLicensesTask'.

The consumer was configured to find a library for use during runtime, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.4.2', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'com.android.build.api.attributes.ProductFlavor:environment' with value 'development', attribute 'com.android.build.api.attributes.ProductFlavor:market' with value 'google', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'. However we cannot choose between the following variants of project :partner-accounts:partner-accounts:
- Configuration ':partner-accounts:partner-accounts:releaseRuntimeElements' variant android-aar-metadata declares a library for use during runtime, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.4.2', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
- Unmatched attributes:
- Doesn't say anything about com.android.build.api.attributes.ProductFlavor:environment (required 'development')
- Doesn't say anything about com.android.build.api.attributes.ProductFlavor:market (required 'google')
- Provides attribute 'artifactType' with value 'android-aar-metadata' but the consumer didn't ask for it
- Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'release' but the consumer didn't ask for it

To Reproduce
Steps to reproduce the behavior:
Update Gradle to 8.8

Desktop (please complete the following information):

  • Gradle version: 8.8
  • Android Studio version: Android Studio Koala
  • Plugin name and version: com.google.android.gms.oss-licenses-plugin" version "0.10.6"

Additional context
Everything works if I downgrade to gradle 8.7

@Blackzion
Copy link

+1. also with Android Studio Jellyfish

@ArcherEmiya05
Copy link

ArcherEmiya05 commented Jul 3, 2024

This is a blocker for us as well, it fails on release variant of a module. We cannot downgrade the Gradle version at the moment. Please let us know if there is a plan on fixing this? Thanks

@Goooler
Copy link

Goooler commented Jul 11, 2024

Consider migrating to https://github.com/cashapp/licensee.

@jakob-grabner
Copy link
Author

Thanks for the tip @Goooler I had a quick look but licensee does not look like a replacement. IT seems to do something different.

@Goooler
Copy link

Goooler commented Jul 11, 2024

You can use the generated JSON file and parse info to show license page like chrisbanes/tivi#1471.

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

No branches or pull requests

4 participants