PalaTeam / flutter_video_cast

MIT License
37 stars 67 forks source link

Android App Crashes on Devices with OS Version 31 and Above #25

Open KinjalDhamat312 opened 1 year ago

KinjalDhamat312 commented 1 year ago

The Flutter_video_cast library seems to function correctly on Android devices with an operating system version of 30 or earlier. However, it crashes on devices with version 31 and higher. Below is the crash log for reference.

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:408)
       at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:688)
       at android.app.PendingIntent.getBroadcast(PendingIntent.java:675)
       at com.google.android.gms.cast.framework.media.internal.zzm.zza(zzm.java:46)
       at com.google.android.gms.cast.framework.CastSession$zza.onResult(CastSession.java:11)
       at com.google.android.gms.common.api.internal.BasePendingResult$CallbackHandler.handleMessage(BasePendingResult.java:11)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:226)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8757)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
socialweb-iaraya commented 1 year ago

Hey @KinjalDhamat312 I was having the same issue, can you update your dependencies like this and see how it goes?

dependencies { ... implementation 'com.google.android.gms:play-services-cast-framework:20.1.0' implementation 'com.google.android.exoplayer:extension-cast:2.11.5' implementation 'androidx.work:work-runtime-ktx:2.7.1' }

KinjalDhamat312 commented 1 year ago

Issue is resolved after upgrading dependencies.