Skip to content

Compose-resources hijacks runtime resource resolution on android runtime #839

@TOTHT0MI

Description

@TOTHT0MI

I've just started to debug my application on real devices. Interestingly the emulator ran fine, but built apks (and aabs) crashed when loading in the app.

After hours debugging I've found, that even though my app uses moko-resources, I was getting the following error:
IllegalStateException: Resource with ID='string:welcome' not found at org.jetbrains.compose.resources.ResourceEnvironmentKt.getResourceItemByEnvironment
This means, that jetbrains' compose-multiplatform is hijacking resource resolution at runtime. This is because newer versions of compose-multiplatform contains resources by default.

To fix the issue I've downgraded multiplatform plugin from 1.8.2 to 1.6.10, and also added exclusions to be sure

 implementation(compose.runtime) {
    exclude(group = "org.jetbrains.compose.resources")
}
implementation(compose.foundation) {
    exclude(group = "org.jetbrains.compose.resources")
 }

I'm mainly creating this issue to raise awarness and provide a temporary fix, however the exclusion should be implemented in the moko resources gradle plugin, or make it compatible with newer versions of compose in an other way!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions