flutter_sound icon indicating copy to clipboard operation
flutter_sound copied to clipboard

[BUG]: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.

Open SmirnovM91 opened this issue 4 years ago • 5 comments

Flutter Sound Version :

  • FULL or LITE flavor ? LITE
  • Important: Result of the command : flutter pub deps | grep flutter_sound
|-- flutter_sound_lite 8.4.2
|   |-- flutter_sound_platform_interface 8.4.2
|   |-- flutter_sound_web 8.4.2
|   |   |-- flutter_sound_platform_interface...

Severity

java.lang.RuntimeException: Unable to create service com.dooboolab.TauEngine.FlautoBackgroundAudioService:

Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.


Platforms you faced the error

  • Android 12 Emulator

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

How can it be fixed?

SmirnovM91 avatar Jan 18 '22 09:01 SmirnovM91

Thank you @SmirnovM91 for your Problem Report. It seems that your problems are tied with Audio Service on Android. Several Flutter Sound users have already reported problems in this area.

We decided to remove everything about Audio Service in the Tau_Sound 9.0 branch. Perhaps it will be a fix for your issue. Now bad news :

  • Tau Sound 9.0 is not yet released and I have no clue when (or even if) it will be released.
  • Tau Sound 9.0 is not backward compatible with Flutter Sound 8.5
  • I do not work anymore on Flutter Sound 8.5. This branch must be maintained by other contributors

I am not sure to have understood correctly your issue. But if Flutter Sound is not compatible anymore with the last Android versions, it is a very important problem and must be solved very soon. If someone has a Pull Request to suggest, he/she will be welcome and I will merge his/her PR into the 8.5 branch.

Larpoux avatar Jan 18 '22 20:01 Larpoux

Updating the dep androidx.media:media to 1.4.1 should fix the crash

https://developer.android.com/jetpack/androidx/releases/media#media-1.4.1

andrea689 avatar Mar 11 '22 16:03 andrea689

Thanks @andrea689 for the info.

Larpoux avatar Mar 11 '22 16:03 Larpoux

I added the dependency in my app, this should fix, but I can't test as I don't have Android 12. I'm deploying the app to the PlayStore, so I can see if my users won't have the problem anymore.

android/app/build.gradle

dependencies {
    implementation 'androidx.media:media:1.4.1'
}

andrea689 avatar Mar 11 '22 17:03 andrea689

@andrea689 : Flutter Sound 9.1.7 is released with your fix. Thank you for your collaboration.

Note : for several weeks i am having several warnings during an Android build. It seems to work fine but I do not have much time to try to understand.

Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Note: /Volumes/mac-J/larpoux/.pub-cache/hosted/pub.dartlang.org/path_provider_android-2.0.11/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Volumes/mac-J/larpoux/.pub-cache/hosted/pub.dartlang.org/flutter_sound-9.1.7/android/src/main/java/com/dooboolab/fluttersound/FlutterSound.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Larpoux avatar Mar 11 '22 19:03 Larpoux

This issue is stale because it has been open 90 days with no activity. Leave a comment or this will be closed in 7 days.

github-actions[bot] avatar Dec 06 '23 01:12 github-actions[bot]