Are there any issues with compose Resources and pr...
# compose-desktop
a
Are there any issues with compose Resources and proguard? I am trying to access a directory that i have in resources using
Res.getUri()
and it works great when i
./gradlew run
, but when i run in release
./gradlew runRelease
I get
Missing resource with path
1
c
FWIW. I'm using conveyor (so at most I run ./gradlew desktopJars and then
conveyor make site
) but when I do that (where i get release/notarized builds on mac) I don't have any issues with these two resource calls
Copy code
val iconPath2 = Res.getUri("files/clock.png")
Res.readBytes("files/credentials.json")
When I get a sec. I can try to do run and runRelease on my same project and see if i get similar issues as you. FWIW. I'm using
1.7.3
of compose multiplatform.
m
I am seeing the same thing. The URI path is a bit unconventional in a released packaged app and probably won't be accepted by most methods. Normal resource references work fine, but for these few that needed to use
Res.getUri()
is just put them in normal java
resources
instead of using Compose resources.
a
+1. I ended up using the regular java resources. Heads up u need to work with the JarFile api if u go down that route:
Copy code
object TempObject

val path = TempObject::class.java.protectionDomain.codeSource.location.toURI().path
val jarFile = JarFile(path)

val allFiles = jarFile.entries().toList()
@Marcin Wisniowski Turns out it's an issue with directories. A more sane approach to this is to zip the contents and unzip it in your app Works for both /wasm and /jvm targets
👀 1
👍 1