I'm having an error while trying to use compose mu...
# android
j
I'm having an error while trying to use compose multiplatform resource in
androidMain
Here's my code:
'void android.media.MediaPlayer.start()' on a null object reference
Copy code
val mediaUri = Res.getUri("files/audio/bell.mp3").toUri()
val mediaPLayer = MediaPlayer.create(context, mediaUri)
mediaPLayer.start()
But in the log i'm able to see the uri as example:
'jar:file:/data/app/~~Be75B5NSPyQ4xPDkY4SRdQ==/com.jamshed.testapp-AI1CWSwJlDZXgylOD7LdPg==/base.apk!/composeResources/com.jamshed.testapp.shared.resources/files/audio/bell.mp3'. (No such file or directory)
c
you cannot access “files” on android. you can use a workaround though. https://github.com/JetBrains/compose-multiplatform/issues/4877
k
Also there's a #C3PQML5NU channel...more than one too for the different types...
☝🏼 1
☝️ 1