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

Raed Ghazal

10/01/2023, 6:32 PM
is there anyother way to use string resources in compose mutliplatform without
moko:resources
?
i would love to use moko, but its not working for me 🤦‍♂️ been trying for hours, keep saying “Expected object ‘SR’ has no actual declaration in module PrayerCompanionAndroid.shared.main”
so I was looking if there is any other native way to do it, but couldn’t find anything
k

Kilian

10/01/2023, 6:54 PM
This is just an ide error. I have this since a long time and everything just works fine.
👀 1
r

Raed Ghazal

10/01/2023, 6:54 PM
it doesn’t run
or idk if I tried honestly 😅
but when I click “Rebuild” keeps telling me build failed
k

Kilian

10/01/2023, 6:55 PM
can you show the log?
r

Raed Ghazal

10/01/2023, 6:56 PM
yeah, well, I removed everything and tried to see a native way to do it, let me reimplement and share with you
btw, any idea why I get these errors
k

Kilian

10/01/2023, 7:29 PM
no sorry never seen this
r

Raed Ghazal

10/01/2023, 7:47 PM
oki thanks
ok trying moko again now
Copy code
Expected object 'SR' has no actual declaration in module <shared_debug> for JVM
here is the error
s

SanjayKarki

10/02/2023, 3:23 AM
if you set kotlin version to 1.8.22 it works but if you update beyond this version then you start getting this error its moko issue they need to fix it.
z

zt

10/02/2023, 6:27 AM
oh I think I actually solved this by adding an explicit dependency on the commonMain source set in the JVM sourceSet
dependsOn(commonMain)
it's working for me on 1.9.10
r

Raed Ghazal

10/02/2023, 7:48 AM
can you share your code for jvm set? I don’t have it at all
Copy code
Expected object 'SR' has no actual declaration in module <shared_release> for JVM
Expected object 'SR' has no actual declaration in module <shared_debug> for JVM
now its showing this I have 2 build types idk if thats related
but even when I see the actual implementation I only see iOS, can’t find anything from android SR = SharedRes
oh 🙂 apparently support for kotlin 1.9 is still pending 🤦‍♂️ I’m using 1.9.10
okay this thing is stupid 😅 I’ve wasted hours and it is not stable at all
I have a strings file in common main that has
test
string, and it is generated, but when I run the app it shows a random string from my androidApp strings file..
8 Views