本文主要是介绍Caused by: android.content.res.Resources$NotFoundException: File res/drawable/main_tab_conversation_,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
机型:coolpad 5951
<span style="color:#444444;">java.lang.RuntimeException: Unable to start activity ComponentInfo{com.yckj.ycsafehelper/com.yckj.ycsafehelper.activity.MainActivity}: android.view.InflateException: Binary XML file line #22: Error inflating class android.widget.Buttonat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2069)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2094)at android.app.ActivityThread.access$600(ActivityThread.java:135)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:137)at android.app.ActivityThread.main(ActivityThread.java:4855)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:511)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)at dalvik.system.NativeStart.main(Native Method) Caused by: android.view.InflateException: Binary XML file line #22: Error inflating class android.widget.Buttonat android.view.LayoutInflater.createView(LayoutInflater.java:613)at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)at android.view.LayoutInflater.inflate(LayoutInflater.java:489)at android.view.LayoutInflater.inflate(LayoutInflater.java:396)at android.view.LayoutInflater.inflate(LayoutInflater.java:352)at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:260)at android.app.Activity.setContentView(Activity.java:1903)at com.yckj.ycsafehelper.activity.MainActivity.onCreate(MainActivity.java:155)at android.app.Activity.performCreate(Activity.java:5051)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1101)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2033)... 11 more Caused by: java.lang.reflect.InvocationTargetExceptionat java.lang.reflect.Constructor.constructNative(Native Method)at java.lang.reflect.Constructor.newInstance(Constructor.java:417)at android.view.LayoutInflater.createView(LayoutInflater.java:587)... 26 more Caused by: android.content.res.Resources$NotFoundException: File res/drawable/main_tab_conversation_s.xml from drawable resource ID #0x7f0201deat android.content.res.Resources.loadDrawable(Resources.java:2064)at android.content.res.TypedArray.getDrawable(TypedArray.java:601)at android.widget.TextView.<init>(TextView.java:767)at android.widget.Button.<init>(Button.java:107)at android.widget.Button.<init>(Button.java:103)... 29 more Caused by: android.content.res.Resources$NotFoundException: File res/drawable-hdpi/tab_img1.png from drawable resource ID #0x7f02023dat android.content.res.Resources.loadDrawable(Resources.java:2104)at android.content.res.Resources.getDrawable(Resources.java:714)at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:881)at android.graphics.drawable.Drawable.createFromXml(Drawable.java:818)at android.content.res.Resources.loadDrawable(Resources.java:2061)... 33 more Caused by: java.io.FileNotFoundException: res/drawable-hdpi/tab_img1.pngat android.content.res.AssetManager.openNonAssetNative(Native Method)at android.content.res.AssetManager.openNonAsset(AssetManager.java:420)at android.content.res.Resources.loadDrawable(Resources.java:2096)... 38 more android.view.InflateException: Binary XML file line #22: Error inflating class android.widget.Buttonat android.view.LayoutInflater.createView(LayoutInflater.java:613)at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)at android.view.LayoutInflater.inflate(LayoutInflater.java:489)at android.view.LayoutInflater.inflate(LayoutInflater.java:396)at android.view.LayoutInflater.inflate(LayoutInflater.java:352)at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:260)at android.app.Activity.setContentView(Activity.java:1903)at com.yckj.ycsafehelper.activity.MainActivity.onCreate(MainActivity.java:155)at android.app.Activity.performCreate(Activity.java:5051)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1101)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2033)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2094)at android.app.ActivityThread.access$600(ActivityThread.java:135)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:137)at android.app.ActivityThread.main(ActivityThread.java:4855)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:511)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.reflect.InvocationTargetExceptionat java.lang.reflect.Constructor.constructNative(Native Method)at java.lang.reflect.Constructor.newInstance(Constructor.java:417)at android.view.LayoutInflater.createView(LayoutInflater.java:587)... 26 more </span><span style="color:#ff0000;">Caused by: android.content.res.Resources$NotFoundException: File res/drawable/main_tab_conversation_s.xml from drawable resource ID #0x7f0201de</span><span style="color:#444444;">at android.content.res.Resources.loadDrawable(Resources.java:2064)at android.content.res.TypedArray.getDrawable(TypedArray.java:601)at android.widget.TextView.<init>(TextView.java:767)at android.widget.Button.<init>(Button.java:107)at android.widget.Button.<init>(Button.java:103)... 29 more Caused by: android.content.res.Resources$NotFoundException: File res/drawable-hdpi/tab_img1.png from drawable resource ID #0x7f02023dat android.content.res.Resources.loadDrawable(Resources.java:2104)at android.content.res.Resources.getDrawable(Resources.java:714)at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:881)at android.graphics.drawable.Drawable.createFromXml(Drawable.java:818)at android.content.res.Resources.loadDrawable(Resources.java:2061)... 33 more Caused by: java.io.FileNotFoundException: res/drawable-hdpi/tab_img1.pngat android.content.res.AssetManager.openNonAssetNative(Native Method)at android.content.res.AssetManager.openNonAsset(AssetManager.java:420)at android.content.res.Resources.loadDrawable(Resources.java:2096)... 38 more java.lang.reflect.InvocationTargetExceptionat java.lang.reflect.Constructor.constructNative(Native Method)at java.lang.reflect.Constructor.newInstance(Constructor.java:417)at android.view.LayoutInflater.createView(LayoutInflater.java:587)at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)at android.view.LayoutInflater.inflate(LayoutInflater.java:489)at android.view.LayoutInflater.inflate(LayoutInflater.java:396)at android.view.LayoutInflater.inflate(LayoutInflater.java:352)at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:260)at android.app.Activity.setContentView(Activity.java:1903)at com.yckj.ycsafehelper.activity.MainActivity.onCreate(MainActivity.java:155)at android.app.Activity.performCreate(Activity.java:5051)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1101)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2033)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2094)at android.app.ActivityThread.access$600(ActivityThread.java:135)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:137)at android.app.ActivityThread.main(ActivityThread.java:4855)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:511)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)at dalvik.system.NativeStart.main(Native Method) Caused by: android.content.res.Resources$NotFoundException: File res/drawable/main_tab_conversation_s.xml from drawable resource ID #0x7f0201deat android.content.res.Resources.loadDrawable(Resources.java:2064)at android.content.res.TypedArray.getDrawable(TypedArray.java:601)at android.widget.TextView.<init>(TextView.java:767)at android.widget.Button.<init>(Button.java:107)at android.widget.Button.<init>(Button.java:103)... 29 more Caused by: android.content.res.Resources$NotFoundException: File res/drawable-hdpi/tab_img1.png from drawable resource ID #0x7f02023dat android.content.res.Resources.loadDrawable(Resources.java:2104)at android.content.res.Resources.getDrawable(Resources.java:714)at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:881)at android.graphics.drawable.Drawable.createFromXml(Drawable.java:818)at android.content.res.Resources.loadDrawable(Resources.java:2061)... 33 more Caused by: java.io.FileNotFoundException: res/drawable-hdpi/tab_img1.pngat android.content.res.AssetManager.openNonAssetNative(Native Method)at android.content.res.AssetManager.openNonAsset(AssetManager.java:420)at android.content.res.Resources.loadDrawable(Resources.java:2096)... 38 more android.content.res.Resources$NotFoundException: File res/drawable/main_tab_conversation_s.xml from drawable resource ID #0x7f0201deat android.content.res.Resources.loadDrawable(Resources.java:2064)at android.content.res.TypedArray.getDrawable(TypedArray.java:601)at android.widget.TextView.<init>(TextView.java:767)at android.widget.Button.<init>(Button.java:107)at android.widget.Button.<init>(Button.java:103)at java.lang.reflect.Constructor.constructNative(Native Method)at java.lang.reflect.Constructor.newInstance(Constructor.java:417)at android.view.LayoutInflater.createView(LayoutInflater.java:587)at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)at android.view.LayoutInflater.inflate(LayoutInflater.java:489)at android.view.LayoutInflater.inflate(LayoutInflater.java:396)at android.view.LayoutInflater.inflate(LayoutInflater.java:352)at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:260)at android.app.Activity.setContentView(Activity.java:1903)at com.yckj.ycsafehelper.activity.MainActivity.onCreate(MainActivity.java:155)at android.app.Activity.performCreate(Activity.java:5051)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1101)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2033)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2094)at android.app.ActivityThread.access$600(ActivityThread.java:135)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:137)at android.app.ActivityThread.main(ActivityThread.java:4855)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:511)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)at dalvik.system.NativeStart.main(Native Method) Caused by: android.content.res.Resources$NotFoundException: File res/drawable-hdpi/tab_img1.png from drawable resource ID #0x7f02023dat android.content.res.Resources.loadDrawable(Resources.java:2104)at android.content.res.Resources.getDrawable(Resources.java:714)at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:881)at android.graphics.drawable.Drawable.createFromXml(Drawable.java:818)at android.content.res.Resources.loadDrawable(Resources.java:2061)... 33 more Caused by: java.io.FileNotFoundException: res/drawable-hdpi/tab_img1.pngat android.content.res.AssetManager.openNonAssetNative(Native Method)at android.content.res.AssetManager.openNonAsset(AssetManager.java:420)at android.content.res.Resources.loadDrawable(Resources.java:2096)... 38 more android.content.res.Resources$NotFoundException: File res/drawable-hdpi/tab_img1.png from drawable resource ID #0x7f02023dat android.content.res.Resources.loadDrawable(Resources.java:2104)at android.content.res.Resources.getDrawable(Resources.java:714)at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:881)at android.graphics.drawable.Drawable.createFromXml(Drawable.java:818)at android.content.res.Resources.loadDrawable(Resources.java:2061)at android.content.res.TypedArray.getDrawable(TypedArray.java:601)at android.widget.TextView.<init>(TextView.java:767)at android.widget.Button.<init>(Button.java:107)at android.widget.Button.<init>(Button.java:103)at java.lang.reflect.Constructor.constructNative(Native Method)at java.lang.reflect.Constructor.newInstance(Constructor.java:417)at android.view.LayoutInflater.createView(LayoutInflater.java:587)at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)at android.view.LayoutInflater.inflate(LayoutInflater.java:489)at android.view.LayoutInflater.inflate(LayoutInflater.java:396)at android.view.LayoutInflater.inflate(LayoutInflater.java:352)at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:260)at android.app.Activity.setContentView(Activity.java:1903)at com.yckj.ycsafehelper.activity.MainActivity.onCreate(MainActivity.java:155)at android.app.Activity.performCreate(Activity.java:5051)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1101)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2033)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2094)at android.app.ActivityThread.access$600(ActivityThread.java:135)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:137)at android.app.ActivityThread.main(ActivityThread.java:4855)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:511)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)at dalvik.system.NativeStart.main(Native Method) Caused by: java.io.FileNotFoundException: res/drawable-hdpi/tab_img1.pngat android.content.res.AssetManager.openNonAssetNative(Native Method)at android.content.res.AssetManager.openNonAsset(AssetManager.java:420)at android.content.res.Resources.loadDrawable(Resources.java:2096)... 38 more java.io.FileNotFoundException: res/drawable-hdpi/tab_img1.pngat android.content.res.AssetManager.openNonAssetNative(Native Method)at android.content.res.AssetManager.openNonAsset(AssetManager.java:420)at android.content.res.Resources.loadDrawable(Resources.java:2096)at android.content.res.Resources.getDrawable(Resources.java:714)at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:881)at android.graphics.drawable.Drawable.createFromXml(Drawable.java:818)at android.content.res.Resources.loadDrawable(Resources.java:2061)at android.content.res.TypedArray.getDrawable(TypedArray.java:601)at android.widget.TextView.<init>(TextView.java:767)at android.widget.Button.<init>(Button.java:107)at android.widget.Button.<init>(Button.java:103)at java.lang.reflect.Constructor.constructNative(Native Method)at java.lang.reflect.Constructor.newInstance(Constructor.java:417)at android.view.LayoutInflater.createView(LayoutInflater.java:587)at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)at android.view.LayoutInflater.inflate(LayoutInflater.java:489)at android.view.LayoutInflater.inflate(LayoutInflater.java:396)at android.view.LayoutInflater.inflate(LayoutInflater.java:352)at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:260)at android.app.Activity.setContentView(Activity.java:1903)at com.yckj.ycsafehelper.activity.MainActivity.onCreate(MainActivity.java:155)at android.app.Activity.performCreate(Activity.java:5051)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1101)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2033)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2094)at android.app.ActivityThread.access$600(ActivityThread.java:135)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:137)at android.app.ActivityThread.main(ActivityThread.java:4855)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:511)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)at dalvik.system.NativeStart.main(Native Method)</span>
Cause:图片资源放到hdpi
Solution: 将图片资源同时放到mdpi或同时配置drawable
Android学习交流群:523487222
(欢迎关注,第一时间推送博文信息)
点击链接加入群【Android学习群】
这篇关于Caused by: android.content.res.Resources$NotFoundException: File res/drawable/main_tab_conversation_的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!