android – 无效的应用程序ID – chromecast
作者:互联网
我正在调整Google Cast代码,提供了here.
我已完成整个工作空间设置,但是,当尝试在Android手机上运行示例应用程序时,我收到以下错误.
我刚刚将包名称指定为app id.我在哪里可以获得应用ID?我应该向Google注册以获取应用ID吗?它是如何工作的?
02-13 23:36:00.995: E/AndroidRuntime(8310): FATAL EXCEPTION: main
02-13 23:36:00.995: E/AndroidRuntime(8310): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.sample.cast.refplayer/com.google.sample.cast.refplayer.VideoBrowserActivity}: java.lang.IllegalArgumentException: Invalid appliation ID: com.google.sample.cast.refplayer
02-13 23:36:00.995: E/AndroidRuntime(8310): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
02-13 23:36:00.995: E/AndroidRuntime(8310): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
02-13 23:36:00.995: E/AndroidRuntime(8310): at android.app.ActivityThread.access$600(ActivityThread.java:127)
02-13 23:36:00.995: E/AndroidRuntime(8310): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
02-13 23:36:00.995: E/AndroidRuntime(8310): at android.os.Handler.dispatchMessage(Handler.java:99)
02-13 23:36:00.995: E/AndroidRuntime(8310): at android.os.Looper.loop(Looper.java:137)
02-13 23:36:00.995: E/AndroidRuntime(8310): at android.app.ActivityThread.main(ActivityThread.java:4511)
02-13 23:36:00.995: E/AndroidRuntime(8310): at java.lang.reflect.Method.invokeNative(Native Method)
02-13 23:36:00.995: E/AndroidRuntime(8310): at java.lang.reflect.Method.invoke(Method.java:511)
02-13 23:36:00.995: E/AndroidRuntime(8310): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
02-13 23:36:00.995: E/AndroidRuntime(8310): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
02-13 23:36:00.995: E/AndroidRuntime(8310): at dalvik.system.NativeStart.main(Native Method)
02-13 23:36:00.995: E/AndroidRuntime(8310): Caused by: java.lang.IllegalArgumentException: Invalid appliation ID:
02-13 23:36:00.995: E/AndroidRuntime(8310): at com.google.android.gms.cast.CastMediaControlIntent.a(Unknown Source)
02-13 23:36:00.995: E/AndroidRuntime(8310): at com.google.android.gms.cast.CastMediaControlIntent.categoryForCast(Unknown Source)
02-13 23:36:00.995: E/AndroidRuntime(8310): at com.google.sample.castcompanionlibrary.cast.BaseCastManager.<init>(BaseCastManager.java:183)
02-13 23:36:00.995: E/AndroidRuntime(8310): at com.google.sample.castcompanionlibrary.cast.VideoCastManager.<init>(VideoCastManager.java:215)
02-13 23:36:00.995: E/AndroidRuntime(8310): at com.google.sample.castcompanionlibrary.cast.VideoCastManager.initialize(VideoCastManager.java:168)
02-13 23:36:00.995: E/AndroidRuntime(8310): at com.google.sample.cast.refplayer.CastApplication.getCastManager(CastApplication.java:51)
02-13 23:36:00.995: E/AndroidRuntime(8310): at com.google.sample.cast.refplayer.VideoBrowserActivity.onCreate(VideoBrowserActivity.java:55)
02-13 23:36:00.995: E/AndroidRuntime(8310): at android.app.Activity.performCreate(Activity.java:4470)
02-13 23:36:00.995: E/AndroidRuntime(8310): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052)
02-13 23:36:00.995: E/AndroidRuntime(8310): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
02-13 23:36:00.995: E/AndroidRuntime(8310): ... 11 more
02-13 23:36:01.115: D/dalvikvm(8310): GC_CONCURRENT freed 168K, 3% free 13426K/13831K, paused 7ms+7ms
02-13 23:36:01.305: I/Process(8310): Sending signal. PID: 8310 SIG: 9
解决方法:
最好的方法是创建自己的接收器(Styled Media Receiver).当您注册时,您会获得一个应用ID;我建议你去Cast developers网站,熟悉Chromecast及其工作原理.获得App Id后,需要将其插入到res / values / string.xml中,其中YOUR_APP_ID字符串为.
标签:google-cast,android,chromecast 来源: https://codeday.me/bug/20190725/1531543.html