Error: Resource File Not Found Exception in thread...
# compose-desktop
s
Error: Resource File Not Found Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: resource common/compose-ui/src/main/res/drawable/ic_spotiflyer_logo.xml not found Getting Resource Not Found tried paths: 1)Repository Path:"common/compose-ui/src/main/res/drawable/ic_spotiflyer_logo.xml" 2) module resources path:"drawable/ic_spotiflyer_logo.xml" But same error , how to verify which path should I use correctly?
Project Structure:
Possible Available Paths: Which to USE?
j
Which function are you passing that path to?
s
message has been deleted
Copy code
vectorXmlResource()
j
I believe that function has identical semantics to
classLoader.getResourceAsStream(String)
. You mentioned that (2) "drawable/ic_spotiflyer_logo.xml" didn't work for you, right? Can you open up the jar file and verify that the xml file exists within your jar at
drawable/ic_spotiflyer_logo.xml
?
I would imagine that you have some sort of gradle configuration issue which is resulting in the resource not being bundled correctly. You can take Compose out of the equation by invoking
Thread.currentThread().contextClassLoader.getResourceAsStream(String)
directly and ensure it returns a non-null value.
s
I will try that , but if gradle had some issues wouldnt that mean android app should throw some errors too , but thats working fine
j
I could be mistaken about this, but IIRC, the android app uses a different mechanism for bundling/loading resources, so it is possible for android to be configured correctly and jvm be wrong (and vice versa I think). Is the
vectorXmlResource()
function even available on Android? I was pretty sure that was a desktop-only code path.
s
It is desktop only , on android , its like R.drawable.name., will try seeing the resource path in jar