I’m trying to add arrow as a dependency on an olde...
# arrow
j
I’m trying to add arrow as a dependency on an older multiplatform project but I’m running in this issue
Copy code
Error while evaluating property 'filteredArgumentsMap' of task ':compileKotlinMetadata'
   > Could not resolve all files for configuration ':metadataCompileClasspath'.
      > Could not resolve io.arrow-kt:arrow-core:1.1.2.
        Required by:
            project :
         > The consumer was configured to find a usage of 'kotlin-api' of a library, preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common'. However we cannot choose between the following variants of io.arrow-kt:arrow-core:1.1.2:
             - iosArm32ApiElements-published
             - iosArm64ApiElements-published
             - iosSimulatorArm64ApiElements-published
             - iosX64ApiElements-published
             - jsApiElements-published
             - jvmApiElements-published
             - jvmRuntimeElements-published
             - linuxX64ApiElements-published
             - macosArm64ApiElements-published
             - macosX64ApiElements-published
             - mingwX64ApiElements-published
             - tvosArm64ApiElements-published
             - tvosSimulatorArm64ApiElements-published
             - tvosX64ApiElements-published
             - watchosArm32ApiElements-published
             - watchosArm64ApiElements-published
             - watchosSimulatorArm64ApiElements-published
             - watchosX64ApiElements-published
             - watchosX86ApiElements-published
this is my commonMain
Copy code
val commonMain by getting {
    dependencies {
        implementation("io.arrow-kt:arrow-core:1.1.2")
        implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1-native-mt")
    }
}
Am I missing something here? I tried to add other multiplatform dependencies like ktor, and it did not have the same issue, it compiled just fine
s
Hey @jean, I am not sure... Do you anything different from https://github.com/arrow-kt/Arrow-MPP-Template/blob/main/build.gradle.kts ? Or a repo you could share?
The Kotlin MPP is a bit strange sometimes. Hopefully it's not some issue between Kotlin versions.
j
It’s in this repo https://github.com/jeantuffier/statemachine. The first thing I noticed compared to the template is the targets, I just use the
ios()
shortcut.
s
I can reproduce it locally but not yet sure what the issue is 😕
@jean it seems to be related to the
kotlin.mpp.enableCompatibilityMetadataVariant=true
flag. We're investigating how to solve atm.
Adding or removing that flag might fix your issue.