Samuel
11/07/2024, 8:25 PMic_launcher_foreground.xml
exists.
Specifically it's found at composeApp/src/androidMain/res/drawable/ic_launcher_foreground.xml
Seri
11/07/2024, 9:39 PMR.drawable
, not Res.drawable
. Make sure that the R file you're importing matches the module containing the resource.Samuel
11/08/2024, 3:44 AMR
in Kotlin Multiplatform; Res
is what I have.Pablichjenkov
11/08/2024, 3:49 AMRes.drawable.mypng
. In androidMain I believe you can use both, R.drawable.my_only_android_png
as traditionally, but you can also resolve Res.drawable.cmp_png
although not advisablePablichjenkov
11/08/2024, 3:52 AMcommonMain/composeResources/drawable
directory. The directory in your screenshot is only accessible from androidMain and you should use R
instead of Res
if that is what you want.Samuel
11/08/2024, 4:10 AMcomposeApp/src/desktopMain/kotlin/dev/myname/main.kt
what do I use here? - For icon =
of Window
?Samuel
11/08/2024, 4:13 AMcomposeApp/src/androidMain/res/drawable
composeApp/src/androidMain/res/drawable-v24
but it needs to be elsewhere. In Android Studio there are no res
directories apart from the androidMain
one; that aren't generated.Pablichjenkov
11/08/2024, 4:26 AMSamuel
11/08/2024, 5:53 PMiconFile.set(rootProject.file("assets/icon.ico"))
for Windows, iconFile.set(rootProject.file("assets/icon.png"))
for Linux. My question is about how to access resources from composeApp/src/desktopMain/kotlin/dev/myappname/main.kt
; what to put in icon=
for my org.jetbrains.compose.ui/ui-desktop/1.8.0-dev1890/c830ee7608c7e0c5d80489c58f3bdc74fe50f079/ui-desktop-1.8.0-dev1890-sources.jar!/desktopMain/androidx/compose/ui/window/Window.desktop.kt
.
I don't seem to be able to access assets that I've imported. Elsewhere in my multiplatform code I use Res.drawable
and it works.Pablichjenkov
11/08/2024, 6:01 PMSamuel
11/09/2024, 1:09 AMRes.drawable.logo
to work? - I've been hacking around a bunch and now it looks like:
% fd -Iexml logo
composeApp/src/debug/res/drawable/logo.xml
composeApp/src/androidMain/res/drawable/logo.xml
composeApp/src/release/res/drawable/logo.xml
composeApp/src/main/res/drawable/logo.xml
composeApp/build/intermediates/packaged_res/debug/packageDebugResources/drawable/logo.xml
composeApp/build/intermediates/packaged_res/release/packageReleaseResources/drawable/logo.xml
But I still can't icon = painterResource(Res.drawable.logo)
Pablichjenkov
11/09/2024, 1:28 AMcommonMain/composeResources/drawable
Samuel
11/09/2024, 2:00 AMcp composeApp/src/debug/res/drawable/logo.xml composeApp/src/commonMain/composeResources/drawable
it doesn't resolve. Trying a bunch of gradle
tasks now to see if any force generationSamuel
11/09/2024, 2:27 AM2.0.20
to 2.0.21
and now it works. No errors, but also no non-default iconSamuel
11/09/2024, 2:29 AMPablichjenkov
11/09/2024, 2:46 AMSamuel
11/09/2024, 2:46 AMcomposeApp/src/commonMain/composeResources/drawable
. Android logos all work now. iOS icon is default [at least in Simulator]. Web has no favicon but that's probably a different setting.Pablichjenkov
11/09/2024, 2:48 AMSamuel
11/09/2024, 3:06 AMSamuel
11/09/2024, 3:07 AM