Skip to content

Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified #315

Description

@HLI5KY

App crashes at runtime with the following error :

java.lang.IllegalArgumentException: de.rampro.activitydiary: 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:404)
	at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:487)
	at android.app.PendingIntent.getActivity(PendingIntent.java:473)
	at android.app.PendingIntent.getActivity(PendingIntent.java:437)
	at de.rampro.activitydiary.helpers.ActivityHelper.showCurrentActivityNotification(ActivityHelper.java:457)
	at de.rampro.activitydiary.helpers.ActivityHelper.setCurrentActivity(ActivityHelper.java:424)
	at de.rampro.activitydiary.ui.main.MainActivity.onItemClick(MainActivity.java:367)
	at de.rampro.activitydiary.ui.main.SelectViewHolders.onClick(SelectViewHolders.java:50)
	at android.view.View.performClick(View.java:7545)
	at android.view.View.performClickInternal(View.java:7522)
	at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
	at android.view.View$PerformClick.run(View.java:29562)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:210)
	at android.os.Looper.loop(Looper.java:299)
	at android.app.ActivityThread.main(ActivityThread.java:8235)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:559)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions