-
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
[Android 14+] InvalidForegroundServiceTypeException #3617
Comments
Hi @shivprakash86, thanks for opening this issue, we'll investigate and provide an update when we can. |
I believe the TransferService needs to pass the FOREGROUND_SERVICE_TYPE_DATA_SYNC flag to if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
startForeground(ongoingNotificationId, userProvidedNotification, ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC);
} else {
startForeground(ongoingNotificationId, userProvidedNotification);
} |
I think this change should be in your s3 SDK TransferService class onStartCommand method |
👍 That's exactly right @shivprakash86. We'll update this very soon for a release next week. |
@mattcreaser Thanks we are waiting. |
The fix has been merged and we will prioritize getting it released soon. Please note the additional changes you will need to make to your AndroidManifest.xml file noted in the PR description: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"/>
<application>
<service
android:name="com.amazonaws.mobileconnectors.s3.transferutility.TransferService"
android:foregroundServiceType="dataSync" />
</application> |
@mattcreaser Yes . |
@mattcreaser is this release above issue? |
Hey @shivprakash86 sorry that no one updated this issue, but this fix was released in version 2.76.1. |
Describe the bug
After upgrading our project to targetSdkVersion version from 33 to 34 we are getting crash InvalidForegroundServiceTypeException: Starting FGS with type none callerApp=ProcessRecord{a64075a 8552:com.xx.xx/u0a196} targetSDK=34 has been prohibited.
To Reproduce
A code sample or steps:
Which AWS service(s) are affected?
AWS s3 media upload service
Environment Information (please complete the following information):
AWS Android SDK Version: [2.76.0]
implementation('com.amazonaws:aws-android-sdk-mobile-client:2.76.0@aar') { transitive = true }
implementation 'com.amazonaws:aws-android-sdk-s3:2.76.0'
Device: [ One Plus, Simulator]
Android Version: [ Upside Down Cake 14]
Specific to simulators: [No]
The text was updated successfully, but these errors were encountered: