After upgrading android studio to Chipmunk Patch 1, Gradle to version 7.4.2 and android gradle plugin to version 7.2.1 I started getting these warnings:Unable to build Kotlin project configuration
org.gradle.internal.component.AmbiguousVariantSelectionException: The consumer was configured to find an API of a component, preferably optimized for Android, as well as attribute'org.jetbrains.kotlin.platform.type' with value 'androidJvm', attribute'com.android.build.api.attributes.BuildTypeAttr' with value 'debug'. However we cannot choose between the following variants of project :common:
- Configuration ':common:debugApiElements' variant android-aidl declares an API of a component, preferably optimized for Android, as well as attribute'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
- Unmatched attributes:
- Provides attribute'artifactType' with value 'android-aidl' but the consumer didn't ask for it
- Provides attribute'com.android.build.api.attributes.AgpVersionAttr' with value '7.2.1' but the consumer didn't ask for it
- Provides attribute'com.android.build.gradle.internal.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it
Am I doing something wrong?
is it a thread now?
3 months ago
Need to remove all the stack trace and code out of the original message so that it is smaller
if you can't find the "post snippet" button (Slack doesn't provide it on mobile and some redesigns have hidden it on desktop), then at least post it in a subthread so it doesn't clutter up the main channel
BTW: this code snippet does not help, because it should work. Could you provide the versions, or better the project?
3 months ago
the problem may possibly in the project using common, not common itself. so it would be best if you could remove the code blocks in the first message, and post all the relevant details in messages within the thread
hard to tell without the complete error and common build script as well, but first guess is that this can happen if common doesn't have a debug buildType and the consumer doesn't have matchingFallbacks set
by the way, both this situation and any other cases the future, the first step you should take is to make a mcve. this will both help you debug the issue, and if it fails, to make it easier responders to spot a problem and verify a solution