Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

IllegalArgumentException: Mutation of _data is not allowed when target Android 14 #110

Open
SteinerOk opened this issue Oct 18, 2023 · 1 comment

Comments

@SteinerOk
Copy link

Describe the bug

I try use modernstorage to file downloading, but when update target to Android 14 start receive this exception

java.lang.IllegalArgumentException: Mutation of _data is not allowed.
                                                                                                	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
                                                                                                	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
                                                                                                	at android.content.ContentProviderProxy.insert(ContentProviderNative.java:589)
                                                                                                	at android.content.ContentResolver.insert(ContentResolver.java:2209)
                                                                                                	at android.content.ContentResolver.insert(ContentResolver.java:2171)
                                                                                                	at com.google.modernstorage.storage.AndroidFileSystem.createMediaStoreUri(AndroidFileSystem.kt:425)

Environment:

  • Android OS version: Android 14
  • Target SDK version API 34
  • Device: Google Pixel 6a
  • ModernStorage version: v1.0.0-alpha06
@numankaraaslan
Copy link

This is happening when saving my video file too.

ContentValues values = new ContentValues(4);
values.put(MediaStore.Video.Media.TITLE, video_id + ".mp4");
values.put(MediaStore.Video.Media.DISPLAY_NAME, video_id + ".mp4");
values.put(MediaStore.Video.Media.MIME_TYPE, "video/mp4");
values.put(MediaStore.Video.Media.DATA, new File(file_path).getAbsolutePath());
getContentResolver().insert(MediaStore.Video.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY), values);

with the same stack trace.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants