videokit-ai / natshare

Cross-platform social sharing for Unity Engine.
https://github.com/natmlx/videokit
Apache License 2.0
134 stars 28 forks source link

Error when saving #106

Closed aholla closed 3 years ago

aholla commented 3 years ago

Hi Im getting an error when the users are trying to save their videos.

If there a way to handle it, seems like the users is denying access.

Caused by java.lang.SecurityException: Permission Denial: writing com.android.providers.media.MediaProvider uri content://media/external/video/media from pid=4043, uid=10297 requires android.permission.WRITE_EXTERNAL_STORAGE, or grantUriPermission() at android.os.Parcel.createException(Parcel.java:1966) at android.os.Parcel.readException(Parcel.java:1934) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135) at android.content.ContentProviderProxy.insert(ContentProviderNative.java:476) at android.content.ContentResolver.insert(ContentResolver.java:1594) at api.natsuite.natshare.SavePayload.lambda$commit$0$SavePayload(SavePayload.java:90) at api.natsuite.natshare.-$$Lambda$SavePayload$H4OYe3fihIsshoXxoPnTnQILE5c.run(:6) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:214) at android.os.HandlerThread.run(HandlerThread.java:65)

olokobayusuf commented 3 years ago

I recommend checking if the user has granted permissions before creating the SavePayload.