flutter_downloader
flutter_downloader copied to clipboard
[SQLiteDatabase] Error inserting bucket_id
trafficstars
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 ?
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...
Up
@hnvn please check issue
@hnvn +
any alternatives for this? I'm facing with this problem after delete item from file manager and try make download again in my app.