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
commonMainMetadataElements variant missing since 0.12.0 (Kotlin 1.6.20) #66
Comments
Hi @baole, thanks for the report! |
Thanks @rickclephas. Yes, it's a library project, target Android and iOS. Here is a snippet of my gradle file
|
I did some digging and this looks like an issue with the Kotlin 1.6.20 update. Probably related to KT-51293. Used the following command to output the variants of the
Comparing the output for c1b7821...24a3255 results in: diff --git a/outgoingVariants-1.6.10.txt b/outgoingVariants-1.6.20-M1.txt
index 64d80cc..ab5f07c 100644
--- a/outgoingVariants-1.6.10.txt
+++ b/outgoingVariants-1.6.20-M1.txt
@@ -1,18 +1,4 @@
> Task :kmp-nativecoroutines-core:outgoingVariants
---------------------------------------------------
-Variant commonMainMetadataElements
---------------------------------------------------
-Capabilities
- - com.rickclephas.kmp:kmp-nativecoroutines-core:0.11.2 (default capability)
-Attributes
- - org.gradle.category = library
- - org.gradle.jvm.environment = non-jvm
- - org.gradle.usage = kotlin-api
- - org.jetbrains.kotlin.platform.type = common
-
-Artifacts
- - build/libs/kmp-nativecoroutines-core-0.11.2.jar (artifactType = jar)
-
--------------------------------------------------
Variant iosArm64ApiElements
--------------------------------------------------
@@ -414,7 +400,7 @@ Attributes
- org.jetbrains.kotlin.platform.type = common
Artifacts
- - build/libs/kmp-nativecoroutines-core-metadata-0.11.2-all.jar (artifactType = jar)
+ - build/libs/kmp-nativecoroutines-core-metadata-0.11.2.jar (artifactType = jar)
--------------------------------------------------
Variant mingwX64ApiElements |
@rickclephas thanks for checking the issue. It works when setting |
Alright that actually makes sense since KMP-NativeCoroutines only supports hierarchical projects. Still it seems something has changed since Kotlin 1.6.20. |
So it turns out the value of The old documentation about migrating to the hierarchical project structure mentioned that Kotlin 1.6.20 introduced Since KMP-NativeCoroutines never explicitly specified the Like you already mentioned, the fix is to disable the compatibility metadata by removing the |
I'm using this library for our shared library and having this following issue after upgrading to version 0.12.x (0.12.0, 0.12.1, 0.12.2 with Kotlin 1.6.21 and 0.12.3 with Kotlin 1.7.0). There is no issue with version 0.11.x. Do you have any idea?
The text was updated successfully, but these errors were encountered: