Skip to content
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

Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles. #892

Open
1 task done
abdoutech93 opened this issue Mar 9, 2023 · 2 comments

Comments

@abdoutech93
Copy link

abdoutech93 commented Mar 9, 2023

🐛 Bug Report

Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.

Java.Lang.IllegalArgumentException: com.xxx.app: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
  at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00088] in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/obj/Release/JniEnvironment.g.cs:12324 
  at Java.Interop.JniPeerMembers+JniInstanceMethods.FinishCreateInstance (System.String constructorSignature, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0003e] in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods.cs:174 
  at Android.Support.V4.Media.Session.MediaSessionCompat..ctor (Android.Content.Context context, System.String tag) [0x0008a] in D:\a\1\s\generated\androidx.media.media\obj\Release\monoandroid9.0\generated\src\Android.Support.V4.Media.Session.MediaSessionCompat.cs:1651 
  at MediaManager.Platforms.Android.MediaSession.MediaBrowserService.PrepareMediaSession () [0x00001] in D:\xxxMobileApp\Lib\XamarinMediaManager-patch\MediaManager\Platforms\Android\MediaSession\MediaBrowserService.cs:91 
  at MediaManager.Platforms.Android.MediaSession.MediaBrowserService.OnCreate () [0x00009] in D:\xxxMobileApp\Lib\XamarinMediaManager-patch\MediaManager\Platforms\Android\MediaSession\MediaBrowserService.cs:49 
  --- End of managed Java.Lang.IllegalArgumentException stack trace ---
java.lang.IllegalArgumentException: com.xxx.app: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
	at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
	at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
	at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
	at android.support.v4.media.session.MediaSessionCompat.<init>(MediaSessionCompat.java:568)
	at android.support.v4.media.session.MediaSessionCompat.<init>(MediaSessionCompat.java:538)
	at android.support.v4.media.session.MediaSessionCompat.<init>(MediaSessionCompat.java:502)
	at android.support.v4.media.session.MediaSessionCompat.<init>(MediaSessionCompat.java:476)
	at crc646e364d2ff34954e7.MediaBrowserService.n_onCreate(Native Method)
	at crc646e364d2ff34954e7.MediaBrowserService.onCreate(MediaBrowserService.java:35)
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:4487)
	at android.app.ActivityThread.access$1700(ActivityThread.java:247)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2072)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7839)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

Expected behavior

playing HLS audio, any exception. notification not displayed.

Reproduction steps

exception in MediaManager here MediaManager\Platforms\Android\MediaSession\MediaBrowserService.cs:91
in the PrepareMediaSession function.

Configuration

TargetSDKVersion 31
Version: 1.1.1.0
branch patch for android 12

Platform:

  • 🤖 Android
@martijn00
Copy link
Member

Please make a PR

@MartinRValdez
Copy link

idem, any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants