korge icon indicating copy to clipboard operation
korge copied to clipboard

Error building multiplatform project with Korio 3.0.0 and kotlin 1.7.10

Open ArtRoman opened this issue 1 year ago • 6 comments

I have an issue in multiplatform project after updating korio dependency when running iOS-related build tasks (linkDebugFrameworkIosX64, linkDebugFrameworkIosX64 or linkPodDebugFrameworkIosFat):

Module "com.soywiz.korlibs.korio:korio (com.soywiz.korlibs.korio:korio-iosx64)" has a reference to symbol kotlin.ranges/contains|-4285521416178503187[0]. Neither the module itself nor its dependencies contain such declaration.

This could happen if the required dependency is missing in the project. Or if there is a dependency of "com.soywiz.korlibs.korio:korio (com.soywiz.korlibs.korio:korio-iosx64)" that has a different version in the project than the version that "com.soywiz.korlibs.korio:korio (com.soywiz.korlibs.korio:korio-iosx64): 3.0.0" was initially compiled with. Please check that the project configuration is correct and has consistent versions of all required dependencies.

The list of "com.soywiz.korlibs.korio:korio (com.soywiz.korlibs.korio:korio-iosx64): 3.0.0" dependencies that may lead to conflicts:

  1. "stdlib: 1.7.10" (was initially compiled with "stdlib: 1.6.21")
  2. "org.jetbrains.kotlin.native.platform.CoreFoundation: 1.7.10" (was initially compiled with "org.jetbrains.kotlin.native.platform.CoreFoundation: 1.6.21")
  3. "org.jetbrains.kotlin.native.platform.Foundation: 1.7.10" (was initially compiled with "org.jetbrains.kotlin.native.platform.Foundation: 1.7.20-Beta")
  4. "org.jetbrains.kotlin.native.platform.Security: 1.7.10" (was initially compiled with "org.jetbrains.kotlin.native.platform.Security: 1.7.20-Beta")
  5. "org.jetbrains.kotlin.native.platform.darwin: 1.7.10" (was initially compiled with "org.jetbrains.kotlin.native.platform.darwin: 1.6.21")
  6. "org.jetbrains.kotlin.native.platform.posix: 1.7.10" (was initially compiled with "org.jetbrains.kotlin.native.platform.posix: 1.6.21")
  7. "org.jetbrains.kotlin.native.platform.zlib: 1.7.10" (was initially compiled with "org.jetbrains.kotlin.native.platform.zlib: 1.7.20-Beta")
  8. "org.jetbrains.kotlinx:atomicfu (org.jetbrains.kotlinx:atomicfu-iosx64): 0.18.3" (was initially compiled with "org.jetbrains.kotlinx:atomicfu (org.jetbrains.kotlinx:atomicfu-iosx64): 0.17.3")

my project build.gradle is like:

kotlin {
    android()

    ios()
    iosSimulatorArm64()

    cocoapods {
        summary = 'Kotlin shared library'
        homepage = 'https://github.com/JetBrains/kotlin'
        ios.deploymentTarget = '13.1'
        podfile = project.file('../iosApp/Podfile')
    }

    sourceSets {
        commonMain {
            dependencies {
                implementation "com.soywiz.korlibs.korio:korio:3.0.0"
                …
           }
        }
    }
}

Korio 2.7.0 works well. Korio 3.0.0-Beta7 works, too. But korio 3.0.0 gives errors, something is wrong with the versions of dependencies. I'm using kotlin 1.7.10.

Serialization 1.4.0 is already released, but kotlin 1.7.20 is still in beta. After setting kotlin to 1.7.20-Beta, korio 3.0.0 is building ok. I don't think it's a good idea to link release-version library with another beta libraries.

ArtRoman avatar Aug 19 '22 15:08 ArtRoman

I don't think it's a good idea to link release-version library with another beta libraries.

I also think it is not a good idea to depend on a beta version of a critical dependency if the library itself is not declared as beta.

svenjacobs avatar Aug 21 '22 10:08 svenjacobs

So the thing is that Kotlin 1.7.10 had some issues when recompiling the project after small changes that broke stuff pretty badly. I could either go back to 1.7.0 or 1.6.x or go ahead, I decided to go ahead.

Note that you can still use the previous beta-7 version that sould be pretty much compatible in terms of source code, and wait for next Korlibs versions that will bump to 1.7.20-RC then 1.7.20, and bump when your other libraries are compatible with the same version.

I was not aware that anyone was using korio outside korge projects, and for korge usually with all the dependencies included and compiled for the same version it was not a big issue and I usually bump versions pretty fast. Can I ask what's your use-case?

soywiz avatar Aug 22 '22 08:08 soywiz

I use korio as a standalone library because it contains the only multiplatform XML parser that I found so far. It would be nice if you could consider users of korio without korge in the future 😉

Anyway, it is not a dealbreaker for me since I downgraded to version 2.7.0 of korio.

Thanks for the great library! 👍🏼

svenjacobs avatar Aug 22 '22 08:08 svenjacobs

Your libraries are very useful for kotlin mpp, so ofc people would use them outside korge. I had the same issue with korio so your suggestion to downgrade to beta-7 helped!

juh9870 avatar Aug 22 '22 11:08 juh9870

Can I ask what's your use-case?

I'm still use korio library for IO and text utilities (gz infalte/deflate, base64, bytes-to-text conversion, etc) and klock library (with custom wrapper) to get multiplatform time/date formatter and parser. They are very useful, thank you for developing!

ArtRoman avatar Aug 22 '22 12:08 ArtRoman

Great. Thank you for sharing your use-cases!

soywiz avatar Aug 22 '22 20:08 soywiz

@soywiz I ran into this as well. I'm using korio in multiplatform tests for file unzip, which is how I ran into #842. I'm ok using Kotlin 1.7.20-RC for now, since my library is still unreleased.

jeffdgr8 avatar Sep 14 '22 19:09 jeffdgr8

3.1.0 is still using -Beta, next version will use -RC. A new version will be probably released next week.

For Kotlin 1.7.20 final, that depends on the kotlin release schedule.

soywiz avatar Sep 15 '22 08:09 soywiz

Hey folks 👋 just released korlibs 3.2.0 using Kotlin 1.7.20 final

soywiz avatar Sep 29 '22 18:09 soywiz