Android Question SDK31 FirebaseNotifications Error

gglaz

Member
Licensed User
Longtime User
Hello,
I get an error on Android 12 when receiving a push notification in the background. It works with Android 7.

java.lang.IllegalArgumentException: *packagename*: Targeting S+ (version 31 and later) requires one of FLAG_IMMUTABLE or FLAG_MUTABLE to be specified when creating a PendingIntent.
Be sure to 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.

As I have done so far
B4X:
AddPermission(android.permission.RECEIVE_BOOT_COMPLETED)
AddReceiverText(FirebaseMessaging, <intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>)


Did I forget something else?
Thanks and Greetings
 

DonManfred

Expert
Licensed User
Longtime User
you did installed a new SDK or are you still using your old SDK-Installation?
 
Upvote 0

gglaz

Member
Licensed User
Longtime User
Hello DonManfred,
since the B4A 12.0 update I use platforms\android-33\android.jar
in the manifest:
B4X:
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="31"/>
 
Upvote 0

gglaz

Member
Licensed User
Longtime User
Hello
thank you very much for your help and time.
I made a very stupid mistake. Instead of just adding references, I overwrote the installed-components.txt file with old values.
 
Upvote 0
Top