Android Question NB6 and Android S+ (version 31+) Crash

Jack Cole

Well-Known Member
Licensed User
Longtime User
Targeting SDK level 31+ gives me a crash when trying to fire a notification using NB6.

Caused by: java.lang.IllegalArgumentException: b4a.example3: 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.getActivityAsUser(PendingIntent.java:458)
at android.app.PendingIntent.getActivity(PendingIntent.java:444)
at android.app.PendingIntent.getActivity(PendingIntent.java:408)
... 32 more

Is there a manifest change that would fix it or is a library update needed?
 
Not sure in what thread I’ve read it these days, but check again the android.jar / targetSDKversion… tutorial
There’s two new sentences regarding SDK 31. one of that lines says:
31 - Push notifications should be sent as high priority messages.

So, try to set priority to high.
 
Upvote 0

Similar Threads

  • Question Question
Android Question NB6 + SDK >=31
Replies
2
Views
2K
Replies
1
Views
4K
Replies
11
Views
16K
  • Question Question
Android Question NB6 example-problem
Replies
1
Views
4K
Back
Top