Cannot choose between the following variants of com.squareup.okio:okio:2.3.0
See original GitHub issueI just upgraded from okio:2.2.2
to okio:2.3.0
and don’t know how to tell gradle which artifact to use 🤔 Is there a documentation how to declare okio for non kotlin-multiplatform projects?
Could not determine the dependencies of task ':main:kaptDebugKotlin'.
> Could not resolve all task dependencies for configuration ':main:kapt'.
> Could not resolve com.squareup.okio:okio:1.16.0.
Required by:
project :main > com.ryanharter.auto.value:auto-value-moshi:0.4.7 > com.squareup.moshi:moshi:1.8.0
> Cannot choose between the following variants of com.squareup.okio:okio:2.3.0:
- jvm-api
- jvm-runtime
- metadata-api
All of them match the consumer attributes:
- Variant 'jvm-api' capability com.squareup.okio:okio:2.3.0:
- Unmatched attributes:
- Required artifactType 'processed-jar' but no value provided.
- Found org.gradle.status 'release' but wasn't required.
- Found org.gradle.usage 'java-api-jars' but wasn't required.
- Found org.jetbrains.kotlin.platform.type 'jvm' but wasn't required.
- Variant 'jvm-runtime' capability com.squareup.okio:okio:2.3.0:
- Unmatched attributes:
- Required artifactType 'processed-jar' but no value provided.
- Found org.gradle.status 'release' but wasn't required.
- Found org.gradle.usage 'java-runtime-jars' but wasn't required.
- Found org.jetbrains.kotlin.platform.type 'jvm' but wasn't required.
- Variant 'metadata-api' capability com.squareup.okio:okio:2.3.0:
- Unmatched attributes:
- Required artifactType 'processed-jar' but no value provided.
- Found org.gradle.status 'release' but wasn't required.
- Found org.gradle.usage 'kotlin-api' but wasn't required.
- Found org.jetbrains.kotlin.platform.type 'common' but wasn't required.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Cannot choose between the following configurations of ...
I trying to generate signed apk but i have one problem: Cannot choose between the following configurations of project :instant: - kapt - ......
Read more >Square Point of Sale App Troubleshooting
Troubleshoot Your Mobile Device. If you notice the Square app isn't acting the way you expect, try the following troubleshooting tips:.
Read more >Error: Cannot choose between the following variants
Hello, I'm trying to upgrade this project from Spring Boot 2.2.4 to 2.4.3 but now I'm running into a Gradle issue: Script ...
Read more >MissingDimensionStrategy not working with Hilt Plugin ...
For that we declare the following in the app's build.gradle : ... However we cannot choose between the following variants of project :mylibrary: ......
Read more >Android consumers can't resolve Android debug variants of ...
However we cannot choose between the following variants of com.example:lib:1.0: - debugApiElements-published - debugRuntimeElements-published ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If you go to start.spring.io and configure a project with Gradle Project; Kotlin; Spring Boot 2.3.0; Packaging Jar; Java 11 download the project, unzip it and add
implementation("com.squareup.okio:okio:2.6.0")
to build.gradle.kts (dependencies) This error will show up when running./gradlew clean build
Removing the line with
kotlin("kapt") version "1.3.72"
doesn’t change anything. Generating a project for SpringBoot version2.2.7.RELEASE
doesn’t show this error.In the end I was able to solve it with this workaround based on the solution described here: https://github.com/google/protobuf-gradle-plugin/issues/391#issuecomment-609958243
I added this to the end of my
build.gradle.kts
I suspect that the Kotlin Gradle plugin should be doing something similar internally, that should hopefully get fixed in subsequent releases. The workaround looks good, I’m gonna keep this issue open in case somebody else experiences it.