I am using cast feature in my application. It was working fine but suddenly I can see the increase in the number of crashes on play store console.
I am initializing CastContext properly as defined in the guidelines and Moreover, I am checking that device is compatible or not before calling this method CastContext.getSharedInstance(context)
So that should not be an issue.
I am not able to reproduce this crash even on emulators with or without google-play-services one.
Any help will be appreciated.
Crash :
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{... .activity.TVActivityPhone}: java.lang.RuntimeException: com.google.android.gms.dynamite.DynamiteModule$zza: Remote load failed. No local fallback found. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2677) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2747) at android.app.ActivityThread.access$900(ActivityThread.java:187) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1584) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5877) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815) Caused by java.lang.RuntimeException: com.google.android.gms.dynamite.DynamiteModule$zza: Remote load failed. No local fallback found.
Code I am getting an error inside the if the condition that means, it's not about the google play service availability.
if (googlePlayServicesVerified(context)) { // checking (result==ConnectionResult.SUCCES)
Log.d("TAG", "instantiated");
castContext = CastContext.getSharedInstance(context);
} else {
Log.e(TAG, "FAILED");
}
Filed bug to google:
https://issuetracker.google.com/issues/65359941
** Update ** Check these two issues :
https://issuetracker.google.com/issues/65359941 https://issuetracker.google.com/issues/79405933
The temporary solution is in my answer.
CastButtonFactory.setUpMediaRouteButton(getApplicationContext(), btnCast);
Any new updates on this issue?