gpt4 book ai didi

Android Chromecast 发件人应用程序 : MediaRouteActionProvider

转载 作者:行者123 更新时间:2023-11-29 14:31:45 26 4
gpt4 key购买 nike

我在使用适用于 Android 的 Chromecast 发送器应用程序时遇到问题。这是我的第二个发件人应用程序,所以总的来说,我已经掌握了基础知识。

什么是对的:

当我直接从 Eclipse 运行该应用程序时,它可以在我的两台测试设备上运行。当我直接从 Android Studio 运行该应用时,它可以在我的两台测试设备上运行。

问题:

当我同时通过 Eclipse 和 Android Studio 生成签名的 APK 时,应用在两台设备上都达到“cast activity”时崩溃。

logcat报错如下:

07-04 12:39:54.887: W/SupportMenuInflater(31144): Cannot instantiate class: android.support.v7.app.MediaRouteActionProvider
07-04 12:39:54.887: W/SupportMenuInflater(31144): java.lang.ClassNotFoundException: Didn't find class "android.support.v7.app.MediaRouteActionProvider" on path: DexPathList[[zip file "/data/app/com.victuallist.shred-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.victuallist.shred-1, /vendor/lib, /system/lib]]
07-04 12:39:54.887: W/SupportMenuInflater(31144): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.support.v7.internal.view.f.a(Unknown Source)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.support.v7.internal.view.f.b(Unknown Source)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.support.v7.internal.view.d.a(Unknown Source)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.support.v7.internal.view.d.inflate(Unknown Source)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at com.victuallist.castgame.CastGameActivity.onCreateOptionsMenu(Unknown Source)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.app.Activity.onCreatePanelMenu(Activity.java:2538)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.support.v4.app.k.onCreatePanelMenu(Unknown Source)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.support.v7.a.g.a(Unknown Source)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.support.v7.a.n.a(Unknown Source)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.support.v7.a.g.onCreatePanelMenu(Unknown Source)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.support.v7.a.o.onCreatePanelMenu(Unknown Source)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:436)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at com.android.internal.policy.impl.PhoneWindow.doInvalidatePanelMenu(PhoneWindow.java:800)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:221)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.view.Choreographer.doCallbacks(Choreographer.java:574)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.view.Choreographer.doFrame(Choreographer.java:543)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.os.Handler.handleCallback(Handler.java:733)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.os.Handler.dispatchMessage(Handler.java:95)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.os.Looper.loop(Looper.java:136)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at android.app.ActivityThread.main(ActivityThread.java:5001)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at java.lang.reflect.Method.invokeNative(Native Method)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at java.lang.reflect.Method.invoke(Method.java:515)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
07-04 12:39:54.887: W/SupportMenuInflater(31144): at dalvik.system.NativeStart.main(Native Method)
07-04 12:39:54.897: D/AndroidRuntime(31144): Shutting down VM
07-04 12:39:54.897: W/dalvikvm(31144): threadid=1: thread exiting with uncaught exception (group=0x41611ba8)
07-04 12:39:54.897: E/AndroidRuntime(31144): FATAL EXCEPTION: main

更新:看来我可以正常工作了。我禁用了proguard。尽管它正在运行,但我仍然想知道为什么会遇到这个问题。任何提示将不胜感激。谢谢。

最佳答案

ProGuard 不会检查菜单资源之类的东西来尝试找到需要免于混淆的类。您从资源中引用的任何类都需要保持不变,通常是通过 ProGuard 配置中的某种形式的 -keep 指令。

可能发生的情况是 ProGuard 混淆了 MediaRouteActionProvider,因此您的代码已编译,但随后 Android 无法通过未混淆的名称找到该类。

关于Android Chromecast 发件人应用程序 : MediaRouteActionProvider,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24578760/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com