cloudinary / cloudinary_android

Android client for integrating with Cloudinary
MIT License
67 stars 59 forks source link

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

Closed lenhatquang97 closed 1 year ago

lenhatquang97 commented 1 year ago

Describe the bug in a sentence or two.

Error log: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE. Although I can upload multiple files to Cloudinary, I don't know how to hide error log.

Issue Type (Can be multiple)

[ ] Build - Can’t install or import the SDK [ ] Performance - Performance issues [ ] Behaviour - Functions aren’t working as expected (Such as generate URL) [ ] Documentation - Inconsistency between the docs and behaviour [x] Other (Specify)

Steps to reproduce

When I use MediaManager.get().upload(url) in Service, it tells error log although uploading works well.

Error screenshots or Stack Trace (if applicable)

2022-11-14 15:20:42.095 19756-19756 JobProxy14              com.quangln2.customfeedui            E  com.quangln2.customfeedui: 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.quangln2.customfeedui: 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:645)
                                                                                                        at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
                                                                                                        at com.evernote.android.job.v14.JobProxy14.getPendingIntent(JobProxy14.java:199)
                                                                                                        at com.evernote.android.job.v14.JobProxy14.cancel(JobProxy14.java:162)
                                                                                                        at com.evernote.android.job.JobProxy$Common.cleanUpOrphanedJob(JobProxy.java:285)
                                                                                                        at com.evernote.android.job.JobManager.schedule(JobManager.java:188)
                                                                                                        at com.evernote.android.job.JobRequest.schedule(JobRequest.java:430)
                                                                                                        at com.cloudinary.android.AndroidJobStrategy.doDispatch(AndroidJobStrategy.java:99)
                                                                                                        at com.cloudinary.android.DefaultRequestDispatcher.dispatch(DefaultRequestDispatcher.java:54)
                                                                                                        at com.cloudinary.android.UploadRequest.doDispatch(UploadRequest.java:245)
                                                                                                        at com.cloudinary.android.UploadRequest.dispatch(UploadRequest.java:202)
                                                                                                        at com.cloudinary.android.UploadRequest.dispatch(UploadRequest.java:170)
                                                                                                        at com.quangln2.customfeedui.domain.workmanager.UploadService.uploadFiles(UploadService.kt:138)
                                                                                                        at com.quangln2.customfeedui.domain.workmanager.UploadService.onStartCommand(UploadService.kt:71)
                                                                                                        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4706)
                                                                                                        at android.app.ActivityThread.access$2000(ActivityThread.java:256)
                                                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2129)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:201)
                                                                                                        at android.os.Looper.loop(Looper.java:288)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:7870)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
2022-11-14 15:20:42.096 19756-19756 JobProxy14              com.quangln2.customfeedui            E  cancel() called with a null PendingIntent
                                                                                                    java.lang.NullPointerException: cancel() called with a null PendingIntent
                                                                                                        at android.app.AlarmManager.cancel(AlarmManager.java:1193)
                                                                                                        at com.evernote.android.job.v14.JobProxy14.cancel(JobProxy14.java:162)
                                                                                                        at com.evernote.android.job.JobProxy$Common.cleanUpOrphanedJob(JobProxy.java:285)
                                                                                                        at com.evernote.android.job.JobManager.schedule(JobManager.java:188)
                                                                                                        at com.evernote.android.job.JobRequest.schedule(JobRequest.java:430)
                                                                                                        at com.cloudinary.android.AndroidJobStrategy.doDispatch(AndroidJobStrategy.java:99)
                                                                                                        at com.cloudinary.android.DefaultRequestDispatcher.dispatch(DefaultRequestDispatcher.java:54)
                                                                                                        at com.cloudinary.android.UploadRequest.doDispatch(UploadRequest.java:245)
                                                                                                        at com.cloudinary.android.UploadRequest.dispatch(UploadRequest.java:202)
                                                                                                        at com.cloudinary.android.UploadRequest.dispatch(UploadRequest.java:170)
                                                                                                        at com.quangln2.customfeedui.domain.workmanager.UploadService.uploadFiles(UploadService.kt:138)
                                                                                                        at com.quangln2.customfeedui.domain.workmanager.UploadService.onStartCommand(UploadService.kt:71)
                                                                                                        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4706)
                                                                                                        at android.app.ActivityThread.access$2000(ActivityThread.java:256)
                                                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2129)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:201)
                                                                                                        at android.os.Looper.loop(Looper.java:288)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:7870)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

Device

Android 12, Google Pixel 6a Cloudinary Android SDK version 2.2.0

michalkcloudinay commented 1 year ago

Hi @lenhatquang97,

Can you please upgrade the SDK version to the latest version - 2.3.0, and let me know if you still see this error? Looking forward to your updates, Thanks

lenhatquang97 commented 1 year ago

Thanks. I have upgraded to 2.3.0 and there is no error log for this. I will close this thread.