我使用 GoogleCastSdkAndroid、mediarouter 和 appcompact 作为依赖项设置了 CastSampleActivity,我能够在手机上构建和启动。但是,生成的应用程序中不会出现 chromecast 图标:
http://i.stack.imgur.com/KxMFJ.png(截图)
当我打开 activity_cast_sample.xml 时,我看到以下内容:
The following classes could not be instantiated:
- android.support.v7.app.MediaRouteButton (Open Class, Show Error Log)
这导致堆栈跟踪:
java.lang.NullPointerException
at com.android.layoutlib.bridge.android.BridgeContext.resolveThemeAttribute(BridgeContext.java:278)
at android.content.res.Resources_Theme_Delegate.resolveAttribute(Resources_Theme_Delegate.java:64)
at android.content.res.Resources$Theme.resolveAttribute(Resources.java:1426)
at android.support.v7.app.MediaRouterThemeHelper.isLightTheme(MediaRouterThemeHelper.java:51)
at android.support.v7.app.MediaRouterThemeHelper.createThemedContext(MediaRouterThemeHelper.java:30)
at android.support.v7.app.MediaRouteButton.<init>(MediaRouteButton.java:121)
at android.support.v7.app.MediaRouteButton.<init>(MediaRouteButton.java:117)
有谁知道发生了什么?
这是来自 GitHub 的完全未经修改的 CastSampleActivity,当然我的 app_id 除外。我可以从 Youtube、Netflix 等进行投射...