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

dev -> main #993

Merged
merged 3 commits into from
May 30, 2024
Merged

dev -> main #993

merged 3 commits into from
May 30, 2024

Conversation

mikepenz
Copy link
Owner

No description provided.

The content of the `AmbiguousArtifactVariantsException` `message` is the following:
```
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.0', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.ProductFlavor:appType' with value 'standalone', attribute 'com.android.build.api.attributes.ProductFlavor:endpoint' with value 'dev', attribute 'com.android.build.api.attributes.ProductFlavor:platform' with value 'androidtv', attribute 'com.android.build.api.attributes.ProductFlavor:tenant' [...]
  [...]
  - Configuration
  [...]
  - Configuration ':coreUi:tenantADebugRuntimeElements' variant supported-locale-list 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.0', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.ProductFlavor:tenant' with value 'tenantA', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
      - Unmatched attributes:
          - Doesn't say anything about com.android.build.api.attributes.ProductFlavor:appType (required 'standalone')
          - Doesn't say anything about com.android.build.api.attributes.ProductFlavor:endpoint (required 'dev')
          - Doesn't say anything about com.android.build.api.attributes.ProductFlavor:platform (required 'androidtv')
          - Provides attribute 'artifactType' with value 'supported-locale-list' but the consumer didn't ask for it
          - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'tenantADebug' but the consumer didn't ask for it
          - Provides attribute 'tenant' with value 'tenantA' but the consumer didn't ask for it
```

So printing the `message` of this exception is also adding a lot of noise to the Gradle logs. It can take up to 157 lines when using four Android Flavors. And this exception is thrown multiple times. In the case of four Flavors 30 times (30*157=4710 lines).

Also the `isDebugEnabled` condition is seemingly inverted. Printing the exception stacktrace for non-debug logs is likely unwanted.

Since `warn` is always printed (`isWarnEnabled` is always `true`) this (expected) exception should only be printed on higher log levels:
* `isInfoEnabled` (enabled via Gradle `--info` CLI parameter) includes only an hint that there's an ambiguity in the resolved config, and *no* details
* `isDebugEnabled` (enabled via Gradle `--debug` CLI parameter) includes the complete exception with all the details
Reduce noise of AmbiguousArtifactVariantsException logs even more
@mikepenz mikepenz merged commit d829008 into main May 30, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants