kotlin.String resource not found in android studio (kmp)
11:13 18 Jul 2026

I'm working on an app and I'm currently in the process of migrating an existing android project to kmp - through a lot of trial and error (lol). I was starting with a super simple file that I use to translate an integer weather code to a string descriptor, but when I try and put it into the shared module, I get the following error:

Class kotlin.String, referenced in function WeatherCode.getDescription(Int?), will not be accessible in module app.shared.commonMain

I have tried checking versions and stdlib is definitely installed. I have also tried syncing the project again as well as clearing the cache. Any insight would be appreciated.

Here's the function if anyone needs it:

object WeatherCode {
    fun getDescription(code: Int?): String {
        return when (code) {
            0 -> "Clear sky"
            1 -> "Mainly clear"
            2 -> "Partly cloudy"
            3 -> "Overcast"
            45, 48 -> "Foggy"
            51, 53, 55 -> "Drizzle"
            61, 63, 65 -> "Rain"
            71, 73, 75 -> "Snow"
            80, 81, 82 -> "Rain showers"
            95, 96, 99 -> "Thunderstorm"
            else -> "Unknown"
        }
    }
}

There are no imports and this is the only function in that file. Any help would be appreciated.

android kotlin kotlin-multiplatform