Alexis
08/02/2025, 10:34 AM@Composable expect
function in commonMain and have successfully implemented the corresponding actual
in iosMain and desktopMain, but I can't make it work in _androidMain_: I have the following error: Unresolved reference 'Icon'. (trying to use an Material3 Icon).
In my gradle I have the following sourceSet
section:
androidMain.dependencies {
implementation(libs.androidx.runtime)
implementation(compose.material3)
implementation(libs.androidx.material3)
implementation(libs.androidx.ui.graphics)
implementation(libs.navigation.compose)
implementation(libs.androidx.activity.compose)
}
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.material3)
implementation(compose.materialIconsExtended)
implementation(compose.ui)
implementation(compose.components.resources)
implementation(compose.components.uiToolingPreview)
implementation(libs.navigation.compose)
}
Before encoutering this problem the android dependencies only included:
implementation(libs.androidx.activity.compose)
, but I've tried implementing other imports to fix the issue...
I'm not sure if I'm missing something or if this is an issue with the IDE since I've already write without any issue expect / actual
composable within this module.
Did anyone encountered a similar issue?
EDIT: If anyone have this issue, it seem like cleaning the cache fix it on my side (so far I've only tried "clean build")...