Skip to content

App crash on startup in A14+ with casting #2178

Closed
@CranberrySoup

Description

@CranberrySoup

Version

Media3 pre-release (alpha, beta or RC not in this list)

More version details

This issue affects both 1.6.0-alpha03 and 1.5.1 (latest alpha and stable as of writing).
Also tested on 4c3ac818 (latest commit 5 hours ago as of this writing)

Devices that reproduce the issue

Any android device with android version 14 and above with google play services installed, but play services are disabled.

I am able to reproduce the issue on the stock android studio emulator with play services running sdk 35.

The app using the cast library needs to target sdk 34+.

Devices that do not reproduce the issue

  • Devices below android 14
  • Devices with play services enabled
  • Devices completely without play services (AOSP emulator).
  • Any app not targeting sdk 34+.

Reproducible in the demo app?

Yes

Reproduction steps

Example:

  1. Use Android Emulator on android 15 with play services installed
  2. Disable play services in app settings
  3. Open the demo-cast app
  4. It instantly crashes

Expected result

The lack of play services should gracefully fail like in older android versions.
In the demo app the app should not crash and instead just show "Failed to get Cast Context. Try updating Google Play Services and restart the app" as it does on sdk < 34 with play services disabled.

Actual result

App crashes with the following stack trace:

Process: androidx.media3.demo.cast, PID: 6441
java.lang.IllegalArgumentException: androidx.media3.demo.cast: Targeting U+ (version 34 and above) disallows creating or retrieving a PendingIntent with FLAG_MUTABLE, an implicit Intent within and without FLAG_NO_CREATE and FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT for security reasons. To retrieve an already existing PendingIntent, use FLAG_NO_CREATE, however, to create a new PendingIntent with an implicit Intent use FLAG_IMMUTABLE.
  at android.os.Parcel.createExceptionOrNull(Parcel.java:3246)
  at android.os.Parcel.createException(Parcel.java:3226)
  at android.os.Parcel.readException(Parcel.java:3209)
  at android.os.Parcel.readException(Parcel.java:3151)
  at android.app.IActivityManager$Stub$Proxy.getIntentSenderWithFeature(IActivityManager.java:7000)
  at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:579)
  at android.app.PendingIntent.getActivity(PendingIntent.java:560)
  at android.app.PendingIntent.getActivity(PendingIntent.java:524)
  at com.google.android.gms.internal.common.zzd.zza(com.google.android.gms:play-services-basement@@18.0.0:1)
  at com.google.android.gms.common.GoogleApiAvailabilityLight.getErrorResolutionPendingIntent(com.google.android.gms:play-services-basement@@18.0.0:3)
  at com.google.android.gms.common.GoogleApiAvailabilityLight.getErrorResolutionPendingIntent(com.google.android.gms:play-services-basement@@18.0.0:1)
  at com.google.android.gms.common.GoogleApiAvailability.getErrorResolutionPendingIntent(com.google.android.gms:play-services-base@@18.0.1:1)
  at com.google.android.gms.common.GoogleApiAvailability.getErrorResolutionPendingIntent(com.google.android.gms:play-services-base@@18.0.1:4)
  at com.google.android.gms.common.GoogleApiAvailability.zah(com.google.android.gms:play-services-base@@18.0.1:2)
  at com.google.android.gms.common.api.internal.GoogleApiManager.zaG(com.google.android.gms:play-services-base@@18.0.1:1)
  at com.google.android.gms.common.api.internal.zabq.zar(com.google.android.gms:play-services-base@@18.0.1:21)
  at com.google.android.gms.common.api.internal.zabq.zao(com.google.android.gms:play-services-base@@18.0.1:13)
  at com.google.android.gms.common.api.internal.zabq.zap(com.google.android.gms:play-services-base@@18.0.1:8)
  at com.google.android.gms.common.api.internal.GoogleApiManager.handleMessage(com.google.android.gms:play-services-base@@18.0.1:64)
  at android.os.Handler.dispatchMessage(Handler.java:103)
  at android.os.Looper.loopOnce(Looper.java:232)
  at android.os.Looper.loop(Looper.java:317)
  at android.os.HandlerThread.run(HandlerThread.java:85)
  Caused by: android.os.RemoteException: Remote stack trace:
  at com.android.server.am.ActivityManagerService.getIntentSenderWithFeatureAsApp(ActivityManagerService.java:5584)
  at com.android.server.am.ActivityManagerService.getIntentSenderWithFeature(ActivityManagerService.java:5526)
  at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3460)
  at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2812)
  at android.os.Binder.execTransactInternal(Binder.java:1500)

Media

Not applicable.

Bug Report

  • You will email the zip file produced by adb bugreport to [email protected] after filing this issue.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions