icerockdev / moko-media

Media selection & presenting for mobile (android & ios) Kotlin Multiplatform development
https://moko.icerock.dev/
Apache License 2.0
120 stars 12 forks source link

error with media on android api 30 #24

Closed denmusic1992 closed 2 years ago

denmusic1992 commented 3 years ago

There is an issue working with MOKO-Media and Permissions on android api 30. When I use this line of code:

viewModelScope.launch {
            try {
                val image: Bitmap = mediaController.pickImage(mediaSource)
                ...
            } catch (error: Exception) {
                ....
            }

and click on "only this time" when allowing the app to use Camera permission, I encounter an exception: java.lang.IllegalArgumentException: Failed to find configured root that contains /image.png

But when I call the pickImage method again, the permission dialog is not being called and the camera will open.

Alex009 commented 3 years ago

this may help - https://www.youtube.com/watch?v=YVniFfQ83dU

Alex009 commented 2 years ago

i test now with "only this time" in sample project - all works fine, without errors