android - 找不到可接受的模块。本地版本为0,远程版本为0

标签 android google-play-services google-cast-sdk android-cast-api

在 Android 项目中添加 Bitmovin Cast 后,我​​在不同设备上遇到了很多相同的问题。

This解决方案没有帮助。

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

- 返回 0(成功)

但是应用程序崩溃了。

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)

所以,Google Play 服务版本是可以的。

最佳答案

根据 this像这样的文章代码可以提供帮助:

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
}

但就我而言,这是 Bitmovin问题

关于android - 找不到可接受的模块。本地版本为0,远程版本为0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54542514/

相关文章:

android - 推送通知是否需要 Google Cloud Messaging Service

java - 无法从静态上下文中引用非静态方法 isGooglePlayServicesAvailable 和 getErrorDialog

ios - 如何剥离 Google cast 未使用的 archs iOS | strip_unused_archs.sh

javascript - 调试 Chromecast 应用程序显示错误消息

android - 默认情况下,音量按钮不使用 cast-sdk v3 从 android 发送器应用程序控制转换设备音量

android - 在 Android 12 启动画面结束之前 fragment 被初始化

java - 连续写入Android中的文本文件

android - 适用于 Android 的 ADAL - 处理错误的正确方法是什么?

android - Android Studio-通过启动自动启动DDMS和模拟器,并在DDMS中自动清除logcat

android - Google 标签管理器不会将事件推送到 Android 上的数据层