levibostian / Wendy-Android

Build offline first Android mobile apps. Remove loading screens, perform tasks instantly.
https://levibostian.github.io/Wendy-Android/wendy/
MIT License
64 stars 16 forks source link

Attempting to prevent crash on newer Android versions #61

Open projectdelta6 opened 2 years ago

projectdelta6 commented 2 years ago

Android API 32+ has a crash with this library

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. java.lang.IllegalArgumentException: com.benchmark.engineer.app: 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:401) at android.app.PendingIntent.buildServicePendingIntent(PendingIntent.java:750) at android.app.PendingIntent.getService(PendingIntent.java:712) at com.evernote.android.job.v21.TransientBundleCompat.cancel(TransientBundleCompat.java:105) at com.evernote.android.job.v21.JobProxy21.cancel(JobProxy21.java:128) at com.evernote.android.job.JobManager.cancelInner(JobManager.java:397) at com.evernote.android.job.JobManager.cancelAllInner(JobManager.java:421) at com.evernote.android.job.JobManager.cancelAllForTag(JobManager.java:391) at com.evernote.android.job.JobManager.schedule(JobManager.java:181) at com.evernote.android.job.JobRequest.schedule(JobRequest.java:414) at com.levibostian.wendy.job.PendingTasksJob$Companion.scheduleJob(PendingTasksJob.kt:35) at com.levibostian.wendy.service.Wendy.init(Wendy.kt:83) at com.levibostian.wendy.service.Wendy.access$init(Wendy.kt:30) at com.levibostian.wendy.service.Wendy$Companion.init(Wendy.kt:46)

So I have updated the version of evernote.android-job as that lib is the root cause of the crash and the newer version claims to have migrated to using android WorkManager.

levibostian commented 1 year ago

Thank you so much for the contribution!

I appreciate your patience with this pull request. I have been AFK for a bit lately and therefore have not kept up on github notifications.

I will review this PR and get a response to you when I am able. In the mean time, I hope you can use your own fork in your project?