So i went through this video for using Compose Mul...
# compose
n
So i went through this video for using Compose Multiplatform for Android / IOS UI, specifically how to use the
Image()
to render an image. However, when i try the same with a .png image Android studio cannot seem to locate the file. I am importing the asset through resource manager but i think the asset ends up in the androidApp folder instead of commonMain. So i made a
Resources
folder inside commonMain manually but it still cannot find the image. Does anyone know the right way to import assets that can be used inside the commonMain folder?

https://youtu.be/FWVi4aV36d8?t=2029

i
Placing pngs to
commonMain/resources
folder should just work. You can use this template or other our examples as a reference In your case I guess the problem is in folder name
Resources
instead of
resources
.
n
@Ivan Matkov Thanks for the reply. Actually my folder is named
resources
correctly. I will try the examples link you sent and try to figure out the issue. Do you know of a way that i can find out which folder path the
painterResource
is scanning for the image? Maybe my project structure might be at fault here.
@Ivan Matkov Hmm.. this is odd. When i do mouseover on the
logo.png
Android Studio shows me the correct logo so i guess it can detect it properly 🤔
Copy code
Image(painter = painterResource("logo.png"), contentDescription = null)
However the error says :
Caused by: org.jetbrains.compose.resources.MissingResourceException: Missing resource with path: logo.png
which means it cannot detect the resource 😕
i
Is it reproducible on template project for you?
n
@Ivan Matkov The logo file loads fine from the template project 🤔