-
Notifications
You must be signed in to change notification settings - Fork 19
Exception on Android #107
Comments
I had the same problem and found a weird workaround I have a global variable in commainMain to store the byte array (this is not necessary, only if you want to do more than just displaying the picked image):
this is my commonMain part:
then in commonMain i have this expect function declared:
The actual implementation in androidMain:
actual implementation in jvmMain:
Furthermore, I have these functions for displaying an Image from just a byte Array:
|
Thanks @lusc8520 ....using adapted version of that now in https://github.com/joreilly/GeminiKMP/blob/main/composeApp/src/androidMain/kotlin/actual.kt |
Could you try this?: |
While folks are waiting on that pr, here's some of the guts of it worked as an extension function so that you can use the library as is. This just steals the main punchline from vinceglb's pr of using contentResolver to turn a Uri into a ByteArray. Assumes the original works correctly in iOS. Handling the non-null assertion and supplying the Android context is dealt with elsewhere. Common: iOS: Android: |
Thanks @randyheaton its works with your workaround. @vinceglb Did you know if the PR is mergeable ? |
@c4software I sent a message to other maintainers, I'll let you know as soon as I have any news 👍 |
@c4software I discuss with Wavesonics, it supposed to have a reviewer before merging. So, I'm waiting to a maintainer to review it. If it takes too long, I'll check with Wavesonics how to proceed. |
Thanks for you feedback 👍 |
I have code that's working fine in other Compose clients but on Android I'm getting following when calling
getFileByteArray
following is code I have
The text was updated successfully, but these errors were encountered: