Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SQLiteDatabase] Error inserting bucket_id #310

Open
EArminjon opened this issue Jun 10, 2020 · 5 comments
Open

[SQLiteDatabase] Error inserting bucket_id #310

EArminjon opened this issue Jun 10, 2020 · 5 comments

Comments

@EArminjon
Copy link

EArminjon commented Jun 10, 2020

I've an issue when downloading file : sometimes i got in my logcat (not into the running console)

2020-06-10 14:29:25.350 17502-17515/android.process.media E/SQLiteDatabase: Error inserting bucket_id=1424065491 date_modified=1591792165 datetaken=1591792165348 bucket_display_name=packages parent=58 format=12299 storage_id=65537 mime_type=video/mp4 media_type=3 _size=8641108 description= title=5eda550887f67_gopr1493.mp4 _data=/storage/emulated/0/Android/data/net.beyondGravity/files/skydivingCentre/packages/5eda550887f67_gopr1493.mp4 date_added=1591792165 _display_name=5eda550887f67_gopr1493.mp4
    android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: files._data (code 2067)
        at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
        at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:782)
        at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788)
        at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
        at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1474)
        at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1343)
        at com.android.providers.media.MediaProvider.insertFile(MediaProvider.java:3282)
        at com.android.providers.media.MediaProvider.insertInternal(MediaProvider.java:3600)
        at com.android.providers.media.MediaProvider.insert(MediaProvider.java:2920)
        at android.content.ContentProvider$Transport.insert(ContentProvider.java:264)
        at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:163)
        at android.os.Binder.execTransact(Binder.java:565)

What happen if several FlutterDownloader.enqueue() are called in same time ?

@EArminjon
Copy link
Author

EArminjon commented Jun 10, 2020

Actually to prevent downloading twice same task i check state with :

String query = "SELECT * FROM task WHERE file_name='$fileName' and saved_dir='$outputPath'";
    List<DownloadTask> tasks = await FlutterDownloader.loadTasksWithRawQuery(query: query);

But issue above freeze the download of some files...

@EArminjon
Copy link
Author

Up

@mminhlequang
Copy link

@hnvn please check issue

@sh4msi
Copy link

sh4msi commented Mar 10, 2022

@hnvn +

@felipecastrosales
Copy link

any alternatives for this? I'm facing with this problem after delete item from file manager and try make download again in my app.

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

No branches or pull requests

4 participants