-
Notifications
You must be signed in to change notification settings - Fork 549
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
Moving from Amplify to TransferUtility causes a crash in the first time. #3232
Comments
Amplify v2 and AWS Android SDK are incompatible with each other, as Amplify v2 migrates data from the AWS Android SDK. Amplify v1 used AWS Android SDK under the hood. |
I need to use 2 different buckets in the same app. Amplify does not support this. So I have to start using the AWS Android SDK. My solution is to delete the database by myself. because the code |
Amplify does not currently support using multiple buckets. However, when using Amplify Android v2, you can use the escape hatch to access the Kotlin SDK, which allows you to specify a bucket name for an operation. For example, to list objects in a given bucket:
|
Closing this as duplicate, issue for multiple bucket support is tracked here. |
I'm also facing the same issue |
|
Describe the bug
Use Amplify 2.5.0 in the app, and then move to use aws-android-sdk-s3 2.65.0. The app crashes.
This is the StackTrace:
FATAL EXCEPTION: DefaultDispatcher-worker-3 Process: riverside.fm, PID: 13864 android.database.sqlite.SQLiteException: table awstransfer already exists (code 1 SQLITE_ERROR[1]): , while compiling: create table awstransfer(_id integer primary key autoincrement, main_upload_id integer, type text not null, state text not null, bucket_name text not null, key text not null, version_id text, bytes_total bigint, bytes_current bigint, speed bigint, is_requester_pays integer, is_encrypted integer, file text not null, file_offset bigint, is_multipart int, part_num int not null, is_last_part integer, multipart_id text, etag text, range_start bigint, range_last bigint, header_content_type text, header_content_language text, header_content_disposition text, header_content_encoding text, header_cache_control text, header_expire text); at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method) at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:1521) at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:957) at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:590) at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:63) at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:34) at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:2628) at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:2550) at com.amazonaws.mobileconnectors.s3.transferutility.TransferTable.onCreate(TransferTable.java:250) at com.amazonaws.mobileconnectors.s3.transferutility.TransferDatabaseHelper.onCreate(TransferDatabaseHelper.java:45) at com.amazonaws.mobileconnectors.s3.transferutility.TransferDatabaseHelper.onDowngrade(TransferDatabaseHelper.java:56) at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:512) at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:413) at com.amazonaws.mobileconnectors.s3.transferutility.TransferDBBase.<init>(TransferDBBase.java:58) at com.amazonaws.mobileconnectors.s3.transferutility.TransferDBUtil.<init>(TransferDBUtil.java:67) at com.amazonaws.mobileconnectors.s3.transferutility.TransferUtility.<init>(TransferUtility.java:330) at com.amazonaws.mobileconnectors.s3.transferutility.TransferUtility.<init>(TransferUtility.java:108) at com.amazonaws.mobileconnectors.s3.transferutility.TransferUtility$Builder.build(TransferUtility.java:304) at riverside.fm.managers.S3Manager$transferUtility$2.invoke(S3Manager.kt:21) at riverside.fm.managers.S3Manager$transferUtility$2.invoke(S3Manager.kt:19) at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) at riverside.fm.managers.S3Manager.getTransferUtility(S3Manager.kt:19) at riverside.fm.utils.Logger$Companion.uploadLogFileToServer(Logger.kt:80) at riverside.fm.android.UploadService.cleanup(UploadService.kt:150) at riverside.fm.android.UploadService.access$cleanup(UploadService.kt:49) at riverside.fm.android.UploadService$onStartCommand$1.invokeSuspend(UploadService.kt:85) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@bde3ac6, Dispatchers.IO]
Environment Information (please complete the following information):
The text was updated successfully, but these errors were encountered: