0

我正在编写 ICS+ 应用程序,它在 Nexus S、Nexus Galaxy、Nexus 7、Galaxy Tab、Galaxy S3 和许多其他设备上运行良好。昨天我得到了 Nexus 4,应用程序在启动过程中崩溃了。

堆栈跟踪如下。我查看了源代码(android.view.ViewConfiguration),设备试图做的是获取褪色的选框资源 - 这里是

mFadingMarqueeEnabled = res.getBoolean(
            com.android.internal.R.bool.config_ui_enableFadingMarquee);

有谁知道会发生什么?

02-04 17:54:09.727: E/AndroidRuntime(16932): java.lang.RuntimeException: Unable to start activity ComponentInfo{myapp/myapp.Main}: android.content.res.Resources$NotFoundException: Resource ID #0x1110013
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.os.Handler.dispatchMessage(Handler.java:99)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.os.Looper.loop(Looper.java:137)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.app.ActivityThread.main(ActivityThread.java:5039)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at java.lang.reflect.Method.invokeNative(Native Method)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at java.lang.reflect.Method.invoke(Method.java:511)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at dalvik.system.NativeStart.main(Native Method)
02-04 17:54:09.727: E/AndroidRuntime(16932): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x1110013
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.content.res.Resources.getValue(Resources.java:1014)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.content.res.Resources.getBoolean(Resources.java:796)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.view.ViewConfiguration.<init>(ViewConfiguration.java:301)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.view.ViewConfiguration.get(ViewConfiguration.java:323)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.view.View.<init>(View.java:3234)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.view.ViewGroup.<init>(ViewGroup.java:420)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.widget.FrameLayout.<init>(FrameLayout.java:93)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at com.android.internal.policy.impl.PhoneWindow$DecorView.<init>(PhoneWindow.java:1816)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at com.android.internal.policy.impl.PhoneWindow.generateDecor(PhoneWindow.java:2585)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2867)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at com.android.internal.policy.impl.PhoneWindow.getDecorView(PhoneWindow.java:1568)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.app.Activity.initActionBar(Activity.java:1861)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.app.Activity.getActionBar(Activity.java:1848)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at myapp.Main.onCreate(Main.java:75)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.app.Activity.performCreate(Activity.java:5104)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
02-04 17:54:09.727: E/AndroidRuntime(16932):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
02-04 17:54:09.727: E/AndroidRuntime(16932):    ... 11 more
4

2 回答 2

1

我不会使用内部资源,因为看起来它们不是公开的(并且可能会发生变化)。

查看The import com.android.internal.R cannot be resolved以获取有关如何使其以您想要的方式工作的更多信息。

于 2013-02-05T19:18:11.200 回答
0

似乎 LG Nexus 4 上安装的 android 框架缺少com.android.internal.R.bool.config_ui_enableFadingMarquee

于 2013-02-05T19:11:49.803 回答