-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Problem situation
The problem arises when increasing the SDK version of the application to be published on the play store. If the SDK version is increased, the application stops on android 12 devices when trying to send a video to play on chromecast.
After investigation, it was discovered that the play-services-cast-framework version should be migrated to 20.1.0 (https://developers.google.com/cast/docs/release-notes#november-16,-2021).
A copy of the project was downloaded, the dependencies were migrated and a test was carried out with partially positive results. It was possible to send a video to play on the chromecast and also to run the basic actions of: pause, play and stop.
A complete test was carried out and it was found that when trying to use the showController() function on any android device, the application fails with no chances of recovery.
Console error: Unable to instantiate activity ComponentInfo{.../com.google.android.gms.cast.framework.media.widget.ExpandedControllerActivity}: java.lang.InstantiationException: java.lang.Class<com.google.android.gms.cast.framework.media.widget.ExpandedControllerActivity> cannot be instantiated.
Which platform(s) does your issue occur on?
The problem occurs on any Android 12 devices or higher versions
How to reproduce the problem?
Run the demo project on an Android 12 device and send a video to play on Chromecast. The application fails with the next error message: requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
If changes of the play-services-cast-framework are performed, this error disappears but the one explained before appears (Console error: Unable to instantiate activity).
Steps that led me to the error message: "Unable to instantiate activity...":
- I updated the include.gradle of the plugin:
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.mediarouter:mediarouter:1.2.5'
implementation 'com.google.android.gms:play-services-cast-framework:20.1.0'
}
- app.gradle of the application:
compileSdkVersion 31
defaultConfig {
minSdkVersion 17
targetSdkVersion 31
generatedDensities = []
}
- I Compiled and run the project on a device.
- I connected to chromecast.
- I sent a video to be played.
- I pressed the Show controller button ((onTap)="handleShowControllerTap()")
Additional data.
Angular version 14.0.0
Nativescript version 8.3.3