Closed odbol closed 3 months ago
Hi @odbol.
Amplify v1 is no longer maintained, so we will not fix this issue and strongly recommend you upgrade to V2.
The docs you linked are for upgrading the Amplify backend (server-side) from Gen1 to Gen2. That is not necessary to move to Amplify v2 - Amplify v2 works with both Gen1 and Gen2 backends.
The migration process for Amplify Android from v1 to v2 is fairly straightforward, there are only a handful of code changes that might be necessary. Please see the migration guide for details.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
Before opening, please confirm:
Language and Async Model
Kotlin, RxJava
Amplify Categories
Storage
Gradle script dependencies
Environment information
Please include any relevant guides or documentation you're referencing
No response
Describe the bug
When calling
RxAmplify.Storage.list(path)
on an Android emulator with SDK 35, it crashes with this exception:Reproduction steps (if applicable)
Code Snippet
Log output
amplifyconfiguration.json
No response
GraphQL Schema
Additional information and screenshots
Since there's no current way to migrate a 1.x project to 2.x, we need a solution for the 1.x library that works with Android SDK 35.
Suggested Solution
Luckily the fix is pretty simple: in
com.amplifyframework.storage.s3.service.AmplifyTransferService$Companion.startForeground()
, make sure you callstartForeground(NOTIFICATION_ID, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC)
instead (notice specifying theServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC
type explicitly).You may also need to add the permission to the manifest:
and add the type to your service manifest declaration: