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

Android 12+ notification creation issue #489

Closed
2 of 3 tasks
wax911 opened this issue Oct 10, 2022 · 0 comments · Fixed by #490
Closed
2 of 3 tasks

Android 12+ notification creation issue #489

wax911 opened this issue Oct 10, 2022 · 0 comments · Fixed by #490

Comments

@wax911
Copy link
Member

wax911 commented Oct 10, 2022

AniTrend Issue Guidelines

Before opening a new issue, please take a moment to review our community guidelines to make the contribution process easy and effective for everyone involved.

You may find an answer in already closed issues:
https://github.com/AniTrend/anitrend-app/issues?q=is%3Aissue+is%3Aclosed

Description Of Bug

On android 12+ notification worker throws an exception upon notification creation with hints towards usage of pending intent flags when targetting the aforementioned API level.

Device & Build Information

  • OS Version: S 12+
  • App Version: N/A
  • Phone Model: N/A
  • Phone Brand: N/A

Donwload Source:

  • Playstore
  • Github
  • Other (specify)

Additional Context

10-09 21:50:14:268 E/NotificationWorker(106742) : java.lang.IllegalArgumentException: com.mxt.anitrend: 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:651)
	at android.app.PendingIntent.getBroadcast(PendingIntent.java:638)
	at com.mxt.anitrend.util.NotificationUtil.clearNotificationsIntent(NotificationUtil.kt:56)
	at com.mxt.anitrend.util.NotificationUtil.createNotification(NotificationUtil.kt:141)
	at com.mxt.anitrend.worker.NotificationWorker.requestNotifications(NotificationWorker.kt:91)
	at com.mxt.anitrend.worker.NotificationWorker.doWork(NotificationWorker.kt:59)
	at androidx.work.CoroutineWorker$startWork$1.invokeSuspend(CoroutineWorker.kt:68)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
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

Successfully merging a pull request may close this issue.

1 participant