Hi , During gradle publish, getting below error: G...
# android
s
Hi , During gradle publish, getting below error: Getting this after Upgraded kotlin to 1.8.20 and AGP to 7.4.2 Error during extraction: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration 'mkopenmeasurementdebugUnitTestCompileClasspath'. at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver.wrapException(ErrorHandlingConfigurationResolver.java:107) at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver$ErrorHandlingResolvedConfiguration.getResolvedArtifacts(ErrorHandlingConfigurationResolver.java:343) at org.jfrog.gradle.plugin.artifactory.extractor.GradleModuleExtractor.calculateDependencies(GradleModuleExtractor.java:132) at org.jfrog.gradle.plugin.artifactory.extractor.GradleModuleExtractor.extractModule(GradleModuleExtractor.java:99) at org.jfrog.gradle.plugin.artifactory.task.ExtractModuleTask.extractModuleFile(ExtractModuleTask.java:31) ......... Caused by: org.gradle.internal.component.AmbiguousVariantSelectionException: The consumer was configured to find an API of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.4.2', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'. However we cannot choose between the following variants of project mkopenmeasurement - Configuration 'mkopenmeasurementdebugApiElements' variant android-aidl declares an API of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.4.2', 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.gradle.internal.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it - Provides a library but the consumer didn't ask for it - Configuration 'mkopenmeasurementdebugApiElements' variant android-lint-local-aar declares an API of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.4.2', 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-lint-local-aar' 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 - Provides a library but the consumer didn't ask for it
🧵 1
👈🏻 1
p
What is your AS version?
s
Android Studio Flamingo | 2022.2.1
p
And you gradle version
s
Copy code
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20
p
Under gradle directory, the wrapper.properties, what version you see
s
Copy code
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
p
Versions seems good.
And one more version check, java, what Java you have installed?
s
Copy code
JavaVersion.VERSION_1_8
p
Java looks a bit outdated. Try using java 11 or java 17. Also you can post this Gradle/build related question in #gradle
s
okay. thank you.
j
@Sanheethaa I had the same problem when I moved my KSP processors from the Java module to the Android module. Could you please let me know what the problem is? Did you manage to resolve it?