https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
y

Yash Garg

11/11/2023, 4:04 PM
Hey, since moko-resources is not yet supported on Kotlin 1.9 and Compose 1.5.x what are you guys using as a replacement for it?
v

Vaibhav Jaiswal

11/11/2023, 4:45 PM
I’m using moko-resources with Kotlin 1.9.20 and it is working correctly
s

Sunil Kumar

11/11/2023, 5:53 PM
Yes. Its working fine with Kotlin 1.9.20
y

Yash Garg

11/11/2023, 6:12 PM
oh, it isn't generating the actual declarations for me. I saw this PR https://github.com/icerockdev/moko-resources/pull/575, multiple people were facing similar issues. None of the solution seem to work for me as of now.
it only generated the
commonMain
file with the resources, did not generate for other targets.
m

Mitchell Syer

11/12/2023, 12:27 AM
If it's not generating the actual declarations, add a dependsOn to commonMain for that sourceset, that's the way I've gotten it to work in my project
If Kotlin complains about the default structure hierarchy, add an applyDefaultProjectHierarchy() function beside the targets, I think that's what it is called at least
y

Yash Garg

11/12/2023, 4:20 AM
I've already tried adding the
dependsOn(commonMain)
in other targets but doesn't seem to work still. It doesn't complain about hierarchy but I'll try using the function if it works.
5 Views