赞
踩
02-06 10:47:46.186: D/AndroidRuntime(2518): Shutting down VM</span>
- 02-06 10:47:46.186: W/dalvikvm(2518): threadid=1: thread exiting with uncaught exception (group=0x41837c08)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): FATAL EXCEPTION: main
- 02-06 10:47:46.201: E/AndroidRuntime(2518): Process: com.taiyiheng.interestlibrary, PID: 2518
- 02-06 10:47:46.201: E/AndroidRuntime(2518): android.view.InflateException: Binary XML file line #17: Error inflating class android.support.v7.internal.widget.TintImageView
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.view.LayoutInflater.createView(LayoutInflater.java:626)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.view.LayoutInflater.inflate(LayoutInflater.java:470)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.support.v7.internal.widget.ActionBarContextView.initForMode(ActionBarContextView.java:212)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.support.v7.app.ActionBarActivityDelegateBase.startSupportActionModeFromWindow(ActionBarActivityDelegateBase.java:650)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.support.v7.app.ActionBarActivityDelegate$1.startActionMode(ActionBarActivityDelegate.java:99)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.support.v7.widget.WindowCallbackWrapper.startActionMode(WindowCallbackWrapper.java:69)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.support.v7.internal.app.ToolbarActionBar.startActionMode(ToolbarActionBar.java:206)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.support.v7.app.ActionBarActivityDelegateBase.startSupportActionMode(ActionBarActivityDelegateBase.java:581)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.support.v7.app.ActionBarActivityDelegateHC.startActionModeForChild(ActionBarActivityDelegateHC.java:62)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.support.v7.internal.widget.NativeActionModeAwareLayout.startActionModeForChild(NativeActionModeAwareLayout.java:44)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:675)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:675)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:675)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.view.View.startActionMode(View.java:4728)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.widget.Editor.startSelectionActionMode(Editor.java:1804)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.widget.Editor.performLongClick(Editor.java:1035)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.widget.TextView.performLongClick(TextView.java:9981)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.view.View$CheckForLongPress.run(View.java:19303)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.os.Handler.handleCallback(Handler.java:733)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.os.Handler.dispatchMessage(Handler.java:95)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.os.Looper.loop(Looper.java:157)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.app.ActivityThread.main(ActivityThread.java:5387)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at java.lang.reflect.Method.invokeNative(Native Method)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at java.lang.reflect.Method.invoke(Method.java:515)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at dalvik.system.NativeStart.main(Native Method)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): Caused by: java.lang.reflect.InvocationTargetException
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at java.lang.reflect.Constructor.constructNative(Native Method)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.view.LayoutInflater.createView(LayoutInflater.java:600)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): ... 28 more
- 02-06 10:47:46.201: E/AndroidRuntime(2518): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x7f010028 a=-1}
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.content.res.Resources.loadDrawable(Resources.java:3014)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.widget.ImageView.<init>(ImageView.java:133)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.support.v7.internal.widget.TintImageView.<init>(TintImageView.java:47)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): at android.support.v7.internal.widget.TintImageView.<init>(TintImageView.java:43)
- 02-06 10:47:46.201: E/AndroidRuntime(2518): ... 31 more
请注意上述错误中的startActionMode(error-log,12行),这是指出了此次错误发生的原因,一个ActionMode,再加上Resource is not a Drawable。
解决方案:请修改App里的Theme,在value的各个版本里,使其<style name="AppTheme" parent="Base.Theme.AppCompat.Light">中的parent直接引用Base.Theme.AppCompat.Light(或者引用包含下面代码中item值的样式),中间可以直接跳过引用Theme.AppCompat.Light等样式。
- <span style="font-size:14px;"> <style name="Base.Theme.AppCompat.Light" parent="Base.V14.Theme.AppCompat.Light">
- <item name="android:actionModeCutDrawable">?actionModeCutDrawable</item>
- <item name="android:actionModeCopyDrawable">?actionModeCopyDrawable</item>
- <item name="android:actionModePasteDrawable">?actionModePasteDrawable</item>
- <item name="android:actionModeSelectAllDrawable">?actionModeSelectAllDrawable</item>
- <item name="android:actionModeShareDrawable">?actionModeShareDrawable</item>
- </style></span>
在有的Theme中可能因为其他原因不能直接找到Base.V7.Theme.AppCompat.Light,在Base.V7.Theme.AppCompat.Light里包含了系统ContextBarMenu的各种背景图片设置,所以就会报Resource文件找不到。
这可能是其中一种解决方法。
另外附上XML代码:value-14
- <resources>
-
- <!--Base application theme for API 14+. This theme completely replaces
- AppBaseTheme from BOTH res/values/styles.xml and
- res/values-v11/styles.xml on API 14+ devices. -->
- <style name="AppTheme" parent="Base.Theme.AppCompat.Light">
- <!-- API 14 theme customizations can go here. -->
- <item name="windowActionBar">false</item>
- <item name="android:windowNoTitle">true</item>
- </style>
-
- </resources>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。