Android inflater exception FileNotFound

After I installed ACRA I started to get all kinds of crash reports. Most makes sense and I fix them as I go. But this one doesn't make much sense to me.

  • This is version running on hundreds of devices - this error happened on this device multiple times within time period and now seems to be fine.
  • I can't reproduce it.
  • res/drawable-mdpi/tire.png indeed exists.
  • This is "glitch" type of exception, but I wonder if there any way to handle this one and maybe someone else see this stack trace different.
  • EDIT:

    I have 2 constructors (not sure how to debug those)

    public TireView(Context context)
        {
            super(context);
            this.mContext = context;
    
            inflateLayout();
        }
    
        public TireView(Context context, AttributeSet attrs)
        {
            super(context, attrs);
            this.mContext = context;
    
            inflateLayout();
    
            final TypedArray a = getContext().obtainStyledAttributes(attrs,R.styleable.TireView);
    
            int i = a.getInteger(R.styleable.TireView_Number, -1);
            if (i != -1)
            {
                setNumber(i);
            }
    
            i = a.getInteger(R.styleable.TireView_Depth, -1);
            if (i != -1)
            {
                setDepth(i);
            }
    
            i = a.getInteger(R.styleable.TireView_Pressure, -1);
            if (i != -1)
            {
                setPressure(i);
            }
    
        }
    

    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.idatt/com.idatt.activities.TrailerInspectionActivity}: android.view.InflateException: Binary XML file line #86: Error inflating class com.idatt.views.TireView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667) at android.app.ActivityThread.access$1500(ActivityThread.java:117)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3687) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
    at dalvik.system.NativeStart.main(Native Method)Caused by: android.view.InflateException: Binary XML file line #86: Error inflating class com.idatt.views.TireView at android.view.LayoutInflater.createView(LayoutInflater.java:518)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570) at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:226) at android.app.Activity.setContentView(Activity.java:1657) at com.idatt.activities.TrailerInspectionActivity.onCreate(SourceFile:279) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615) ... 11 moreCaused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Constructor.constructNative(Native Method)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
    at android.view.LayoutInflater.createView(LayoutInflater.java:505)
    ... 26 moreCaused by: android.content.res.Resources$NotFoundException: File res/drawable-mdpi/tire.png from drawable resource ID #0x7f02002a at android.content.res.Resources.loadDrawable(Resources.java:1714)
    at android.content.res.Resources.getDrawable(Resources.java:581)
    at android.view.View.setBackgroundResource(View.java:7533) at com.idatt.views.TireView.a(SourceFile:65) at com.idatt.views.TireView.(SourceFile:38) ... 29 moreCaused by: java.io.FileNotFoundException: res/drawable-mdpi/tire.png at android.content.res.AssetManager.openNonAssetNative(Native Method)
    at android.content.res.AssetManager.openNonAsset(AssetManager.java:406)
    at android.content.res.Resources.loadDrawable(Resources.java:1706)
    ... 33 moreandroid.view.InflateException: Binary XML file line #86: Error inflating class com.idatt.views.TireView at android.view.LayoutInflater.createView(LayoutInflater.java:518)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570) at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:226) at android.app.Activity.setContentView(Activity.java:1657) at com.idatt.activities.TrailerInspectionActivity.onCreate(SourceFile:279) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667) at android.app.ActivityThread.access$1500(ActivityThread.java:117)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3687) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
    at dalvik.system.NativeStart.main(Native Method)Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
    at android.view.LayoutInflater.createView(LayoutInflater.java:505)
    ... 26 moreCaused by: android.content.res.Resources$NotFoundException: File res/drawable-mdpi/tire.png from drawable resource ID #0x7f02002a at android.content.res.Resources.loadDrawable(Resources.java:1714)
    at android.content.res.Resources.getDrawable(Resources.java:581)
    at android.view.View.setBackgroundResource(View.java:7533) at com.idatt.views.TireView.a(SourceFile:65) at com.idatt.views.TireView.(SourceFile:38) ... 29 moreCaused by: java.io.FileNotFoundException: res/drawable-mdpi/tire.png at android.content.res.AssetManager.openNonAssetNative(Native Method)
    at android.content.res.AssetManager.openNonAsset(AssetManager.java:406)
    at android.content.res.Resources.loadDrawable(Resources.java:1706)
    ... 33 morejava.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
    at android.view.LayoutInflater.createView(LayoutInflater.java:505)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570) at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:226) at android.app.Activity.setContentView(Activity.java:1657) at com.idatt.activities.TrailerInspectionActivity.onCreate(SourceFile:279) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667) at android.app.ActivityThread.access$1500(ActivityThread.java:117)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3687) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
    at dalvik.system.NativeStart.main(Native Method)Caused by: android.content.res.Resources$NotFoundException: File res/drawable-mdpi/tire.png from drawable resource ID #0x7f02002a
    at android.content.res.Resources.loadDrawable(Resources.java:1714)
    at android.content.res.Resources.getDrawable(Resources.java:581)
    at android.view.View.setBackgroundResource(View.java:7533) at com.idatt.views.TireView.a(SourceFile:65) at com.idatt.views.TireView.(SourceFile:38) ... 29 moreCaused by: java.io.FileNotFoundException: res/drawable-mdpi/tire.png at android.content.res.AssetManager.openNonAssetNative(Native Method)
    at android.content.res.AssetManager.openNonAsset(AssetManager.java:406)
    at android.content.res.Resources.loadDrawable(Resources.java:1706)
    ... 33 moreandroid.content.res.Resources$NotFoundException: File res/drawable-mdpi/tire.png from drawable resource ID #0x7f02002a
    at android.content.res.Resources.loadDrawable(Resources.java:1714)
    at android.content.res.Resources.getDrawable(Resources.java:581)
    at android.view.View.setBackgroundResource(View.java:7533) at com.idatt.views.TireView.a(SourceFile:65) at com.idatt.views.TireView.(SourceFile:38) at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
    at android.view.LayoutInflater.createView(LayoutInflater.java:505)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570) at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:226) at android.app.Activity.setContentView(Activity.java:1657) at com.idatt.activities.TrailerInspectionActivity.onCreate(SourceFile:279) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667) at android.app.ActivityThread.access$1500(ActivityThread.java:117)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3687) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
    at dalvik.system.NativeStart.main(Native Method)Caused by: java.io.FileNotFoundException: res/drawable-mdpi/tire.png at android.content.res.AssetManager.openNonAssetNative(Native Method)
    at android.content.res.AssetManager.openNonAsset(AssetManager.java:406)
    at android.content.res.Resources.loadDrawable(Resources.java:1706)
    ... 33 morejava.io.FileNotFoundException: res/drawable-mdpi/tire.png
    at android.content.res.AssetManager.openNonAssetNative(Native Method) at android.content.res.AssetManager.openNonAsset(AssetManager.java:406)
    at android.content.res.Resources.loadDrawable(Resources.java:1706)
    at android.content.res.Resources.getDrawable(Resources.java:581)
    at android.view.View.setBackgroundResource(View.java:7533) at com.idatt.views.TireView.a(SourceFile:65) at com.idatt.views.TireView.(SourceFile:38) at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
    at android.view.LayoutInflater.createView(LayoutInflater.java:505)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570) at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:226) at android.app.Activity.setContentView(Activity.java:1657) at com.idatt.activities.TrailerInspectionActivity.onCreate(SourceFile:279) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667) at android.app.ActivityThread.access$1500(ActivityThread.java:117)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3687) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
    at dalvik.system.NativeStart.main(Native Method)

    链接地址: http://www.djcxy.com/p/96810.html

    上一篇: webview和listview在同一个活动中

    下一篇: Android inflater例外FileNotFound