The class android.media.session.MediaSession for creating a media notification no longer works properly in the newer Android versions (from version 11). Therefore I want to use android/support/v4/media/session/MediaSessionCompat.
I compiled an empty project to see which classes App Inventor provides by default. Some of the android/support/v4 modules are available. Unfortunately, the media module is not:

I have downloaded the module from the Maven repository and include it as an external library. Depending on which version of the module I use, there are different problems:
With version 1.4.1 and above I get the following error:
03-11 09:25:08.410 13539 13539 I Notifier: One button alert java.lang.NoSuchMethodError: No static method putVersionedParcelable(Landroid/os/Bundle;Ljava/lang/String;Landroidx/versionedparcelable/VersionedParcelable;)V in class Landroidx/versionedparcelable/ParcelUtils; or its super classes (declaration of 'androidx.versionedparcelable.ParcelUtils' appears in /data/app/~~WhDem8gqrljlBnmGMG-R8Q==/appinventor.ai_bienonline.UrsMediaNotification_3_X_148-Q2BqgqJKC2sqjVkaaXPhhQ==/base.apk!classes2.dex)
It says that Method Androidx/versionedparcelable/ParcelUtils.putVersionedParcelable is missing. Inspecting the apk of the empty projekt you can see, that this method is not present.

In the Maven repository you can find the package androidx.versionedparcelable. Newer versions of this package supply the missing function.
Conclusion: Version 1.4.1 of android/support/v4/media is to new for App Inventor.
With version 1.4.0 and below I get another error:
03-11 09:28:30.230 15570 15570 D MEDIA : Constructor: java.lang.IllegalArgumentException: appinventor.ai_bienonline.UrsMediaNotification_3_X_148: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
03-11 09:28:30.230 15570 15570 D MEDIA : 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.
03-11 09:28:30.231 15570 15570 D MEDIA : java.lang.IllegalArgumentException: appinventor.ai_bienonline.UrsMediaNotification_3_X_148: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
03-11 09:28:30.231 15570 15570 D MEDIA : 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.
03-11 09:28:30.231 15570 15570 D MEDIA : at android.app.PendingIntent.checkPendingIntent(PendingIntent.java:458)
03-11 09:28:30.231 15570 15570 D MEDIA : at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:761)
03-11 09:28:30.231 15570 15570 D MEDIA : at android.app.PendingIntent.getBroadcast(PendingIntent.java:748)
03-11 09:28:30.231 15570 15570 D MEDIA : at android.support.v4.media.session.MediaSessionCompat.(MediaSessionCompat.java:568)
03-11 09:28:30.231 15570 15570 D MEDIA : at android.support.v4.media.session.MediaSessionCompat.(MediaSessionCompat.java:538)
That says Version 1.4.0 of android/support/v4/media is to old for the device.
Finally, I used version 1.3.1 and provided the constructor of the MediaSessionCompat instance with a self-created PendingIntent which is identical to the one from the class but has been provided with FLAG_MUTABLE. Now the MediaNotification is created and also displayed.
But if you call it, this error appears again: Method Androidx/versionedparcelable/ParcelUtils.putVersionedParcelableis missing
I hope that the errors will disappear if I can include a newer version of androidx.versionedparcelable.ParcelUtils. I already tried that, but then I couldn't compile the project anymore.
Is there an option to include a newer version of androidx.versionedparcelable.ParcelUtils?