How to avoid duplicated Compose Multiplatform resources (strings & drawables) across core and feature modules?

1 week ago 8
ARTICLE AD BOX

I'm working on a Compose Multiplatform project (CMP) with multiple feature modules.
Each feature module contains a composeResources folder with drawable and values (strings,...) inside.

The issue is that some strings or icons are shared across multiple features, but CMP currently requires resources to be placed inside each module’s composeResources directory.
This leads to duplicated resources, for example:

Feature: Home

string name="feature_home_hi">hi</string>

Feature: Account

<string name="feature_account_hi">hi</string>

Feature: Profile

<string name="feature_profile_hi">hi</string>

The same duplicated situation happens with icons as well. Because these assets are repeated across 3+ modules, the APK size grows unnecessarily.

❓ Question:

What is the best practice in Compose Multiplatform to avoid duplicating common resources (strings and drawables) across feature modules?

Is there a recommended approach such as:

A shared resource module? A common resources bundle? Using Gradle source sets in a shared module? Or any CMP-specific way to reference resources without duplicating files?

Thanks in advance!

Read Entire Article