Skip to content
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

Projects using the no-arg module fail to build in Kotlin 1.6.20 #106

Closed
MarkRS-UK opened this issue Apr 5, 2022 · 8 comments
Closed

Projects using the no-arg module fail to build in Kotlin 1.6.20 #106

MarkRS-UK opened this issue Apr 5, 2022 · 8 comments

Comments

@MarkRS-UK
Copy link

Trying to upgrade my project to 1.6.20 causes the iOS (but not Android) executable to fail. It complains

> Task :mobilemanegesharedmodule:linkDebugFrameworkIos FAILED
e: The symbol of unexpected type encountered during IR deserialization: IrSimpleFunctionPublicSymbolImpl, com.russhwolf.settings/Settings|-62081702699614493[0]. IrClassifierSymbol is expected.

This could happen if there are two libraries, where one library was compiled against the different version of the other library than the one currently used in the project. Please check that the project configuration is correct and has consistent versions of dependencies.

and then

+--- com.russhwolf:multiplatform-settings-no-arg (com.russhwolf:multiplatform-settings-no-arg-iosx64): 0.8.1
|    ^^^ This module contains symbol com.russhwolf.settings/Settings|-62081702699614493[0] that is the cause of the conflict.
|    +--- com.russhwolf:multiplatform-settings (com.russhwolf:multiplatform-settings-iosx64): 0.8.1
|    |    ^^^ This module contains symbol com.russhwolf.settings/Settings|-62081702699614493[0] that is the cause of the conflict.

Seems a little odd since I see you've already allowed for HMPP it seems. Perhaps it's Kermit causing the trouble?

@marcorighini
Copy link

marcorighini commented Apr 6, 2022

Hi @russhwolf, is there a plan to release a version supporting kotlin 1.6.x in the short term? Thanks

@russhwolf
Copy link
Owner

The current version definitely works in 1.6.10. I haven't had a chance to look at what's happening here with 1.6.20, but should be able to take a look and put out an update if necessary in the next few days.

@marcorighini
Copy link

Considering that we are dealing in particular with kotlin native code, it would be safer in any case to have a version of the library compiled against the latest kotlin 1.6.20 version. What do you think?

@russhwolf
Copy link
Owner

@MarkRS-UK I'm able to reproduce the issue in the sample app by including the no-arg module. It doesn't seem to go away if I bump the library to 1.6.20, so I'm going to need to dig more. In the meantime, you can workaround by injecting your Settings instances from each platform instead of using no-arg.

@marcorighini Kotlin/Native has been experimentally backward-compatible since 1.4.0, and I'm not aware of any breakages since then. As such I have not been rushing to put out a library update each time there's a new Kotlin version.

@MarkRS-UK
Copy link
Author

Yes, I've been using no-arg. I'll look at changing that.

@russhwolf russhwolf changed the title Causes a project using Kotlin 1.6.20 to fail to build Projects using the no-arg module fail to build in Kotlin 1.6.20 Apr 9, 2022
@russhwolf
Copy link
Owner

I've been able to isolate this to an issue in Kotlin 1.6.20 and reported it on Youtrack. You can follow it here: https://youtrack.jetbrains.com/issue/KT-51927

@russhwolf
Copy link
Owner

I've confirmed that you can work around the issue while still using the current published version of the library by disabling compiler optimizations as recommended in the YouTrack ticket above. Add something like this to your gradle file:

kotlin {
    targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget> {
        binaries.all {
            freeCompilerArgs += "-Xlazy-ir-for-caches=disable"
        }
    }
}

@russhwolf
Copy link
Owner

I've confirmed the issue is fixed in Kotlin 1.6.21. If you're using that Kotlin version, you should have no issues using the published version of the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants