arkivanov / Essenty

The most essential libraries for Kotlin Multiplatform development
Apache License 2.0
482 stars 15 forks source link

Unresolved reference: Parcelize #79

Closed DatL4g closed 1 year ago

DatL4g commented 1 year ago

The latest version (0.7.0) shows the Parcelize annotation red with this error message: "Unresolved reference: Parcelize" in IntelliJ Ultimate 2022.3.1

This is NOT urgent as the project builds fine, just a little annoying.

Version 0.6.0 doesn't have this problem.

arkivanov commented 1 year ago

That might be an issue with IDEA. You can try deleting the .idea folder and reopening the project, and see if this helps. Also what Kotlin version you are using? Can you try Kotlin 1.7.21? Do you have a reproducer project?

arkivanov commented 1 year ago

I have just checked, it works just fine for me:

DatL4g commented 1 year ago

I tried deleting the .idea folder but that didn't help. I'm using Kotlin version 1.7.22

I don't really have a reproducer project, but this is the project I'm facing this issue. (compose branch) It's not that small so for explanation:

Example class having this issue dev.datlag.burningseries.ui.screen.home.HomeScreenComponent

arkivanov commented 1 year ago

Thanks! Looks like it was broken in #73. Parcelize annotation was marked as @OptionalExpectation and removed from all non-Android targets. Since you are using only android and jvm targets, it resolves to the jvm artifact (not common) which doesn't have Parcelize anymore. I will revert this particular change.

arkivanov commented 1 year ago

I think this happens because Kotlin commonizer doesn't support sharing android and jvm source sets yet. So it defaults to just jvm.

arkivanov commented 1 year ago

Looks like we can't use @OptionalExpectation at all, I will avoid it completely for now.

Cc: @sellmair

arkivanov commented 1 year ago

Version 0.7.1 is released and should fix this issue. Please allow ~2 hours for artifacts to fully propagate.

DatL4g commented 1 year ago

Works like a charm, btw I just check the artifact availability here https://repo1.maven.org/maven2/com/arkivanov/essenty/parcelable/

arkivanov commented 1 year ago

Yeah, it's often faster than 2 hours. But there are more target-specific artifacts, they are synchronized in batches, so some targets may be still missing. https://repo1.maven.org/maven2/com/arkivanov/essenty/

MaxElkin commented 1 year ago

The issue can still be reproduced on latest version 1.1.0 for nested classes.

arkivanov commented 1 year ago

Can you share a reproducer?

MaxElkin commented 1 year ago

Maybe later