Mark
05/11/2025, 12:43 PM@StringRes Int
in a Android library module that has the KMP module as a dependency.
I thought this might do it, but no luck so far:
experimentalProperties["android.experimental.kmp.enableAndroidResources"] = true
This is pretty important for incremental migration. Perhaps I could dynamically include the strings.xml
of the KMP module in the resources of the Android module?Mark
05/11/2025, 2:51 PMstrings.xml
can be placed in androidMain
and accessed by Android modules in the normal way. For strings.xml
in commonMain
, those are accessed via Res.string.foo
but there seems to be no way to interop between the two?
I’ve got many classes (mostly enums) that have a property of type @StringRes Int
so am looking for a good migration strategy. Presumably those should be type StringResource
instead.Tim Karagosian
05/14/2025, 8:16 AMMark
05/14/2025, 9:38 AMRes
etc, but it seems not the case. I was hoping that resources could be declared in commonMain, and then there would be a simple way to auto-generate a legacy R class to support legacy Android code interop. My current strategy of adding a android-only module dependency mostly works for now.
https://kotlinlang.slack.com/archives/C3PQML5NU/p1747197830968499Tim Karagosian
05/14/2025, 9:53 AMMark
05/14/2025, 9:58 AM