10

After adding Bitmovin Cast in Android project I get a lot of same issues from different devices.

This solution didn't help.

GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(getContext()) 

- returns 0 (SUCCESS)

But app crashes.

Caused by java.lang.RuntimeException: com.google.android.gms.dynamite.DynamiteModule$LoadingException: No acceptable module found. Local version is 0 and remote version is 0.
       at com.google.android.gms.internal.cast.zze.zzf(Unknown Source:51)
       at com.google.android.gms.internal.cast.zze.zza(Unknown Source:1)
       at com.google.android.gms.cast.framework.CastContext.(Unknown Source:37)
       at com.google.android.gms.cast.framework.CastContext.getSharedInstance(Unknown Source:6)
       at com.bitmovin.player.BitmovinPlayer.(SourceFile:106)
       at com.bitmovin.player.BitmovinPlayer.(SourceFile:82)
       at com.bitmovin.player.BitmovinPlayer.(SourceFile:71)
       at com.bitmovin.player.BitmovinPlayerView.(SourceFile:134)
       at com.bitmovin.player.BitmovinPlayerView.(SourceFile:120)

So, Google Play services version is ok.

ChebTS
  • 311
  • 1
  • 3
  • 10

3 Answers3

8

According to this article code like this can help:

fun isCastApiAvailable(): Boolean {
    val isCastApiAvailable = isNotTv(context)
            && GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context) == ConnectionResult.SUCCESS
    try {
        CastContext.getSharedInstance(context)
    } catch (e: Exception) {
        // track non-fatal
        return false
    }
    return isCastApiAvailable
}

fun isNotTv(Context context): Boolean {
    UiModeManager uiModeManager = (UiModeManager) context.getSystemService(UI_MODE_SERVICE)
    return uiModeManager.getCurrentModeType() != Configuration.UI_MODE_TYPE_TELEVISION
}

But in my case, this is Bitmovin issue

Petr Bela
  • 8,493
  • 2
  • 33
  • 37
ChebTS
  • 311
  • 1
  • 3
  • 10
6

It's because either your device or emulator has an out-dated version of Google Play services. Right above your error you should see something in the log cat that says

Google Play services out of date. Requires 3264100 but found 3225132

Just update the Google Play services and it'll work.

source https://github.com/googlesamples/android-UniversalMusicPlayer/issues/97

Yuliia Ashomok
  • 8,336
  • 2
  • 60
  • 69
0

You might be using a emulator or flashed device, try testing on a normal play services updated device, should work.

shubham chouhan
  • 580
  • 7
  • 8