I'm seeing an intermittent crash from a few devices in the wild where Android reports FileNotFoundException inflating a resource file. Initially, it was just Android SDK provided resources:
res/interpolator/linear_out_slow_in.xml
res/color/highlighted_text_material.xml
But I now just got one crash with our own file:
res/layout/listitem_spinner_text.xml
I found some other posts mentioning minifyEnabled and shrinkResources, but my app does not have those enabled. (Specifically, minifyEnabled is set to false, and shrinkResources is not in the gradle file)
The one thing that stands out is I've only seen the crash on Pixel Devices, which I believe are all OS version 7+.
I doubt the xml files are getting excluded because I am unable to reproduce the crash on any device or a Pixel in the emulator.
What could be causing this crash?
My app is currently built with buildToolsVersion 25.0.2 and gradle 2.2.3 I guess my next step might be to try to reproduce on a real device in one of the cloud farms?
Here is one of the crashes:
java.io.FileNotFoundException: res/interpolator/linear_out_slow_in.xml
at android.content.res.AssetManager.openXmlAssetNative()(AssetManager.java:-2)
at android.content.res.AssetManager.openXmlBlockAsset()(AssetManager.java:519)
at android.content.res.ResourcesImpl.loadXmlResourceParser()(ResourcesImpl.java:975)
at android.content.res.Resources.loadXmlResourceParser()(Resources.java:2103)
at android.content.res.Resources.getAnimation()(Resources.java:1139)
at android.view.animation.AnimationUtils.loadInterpolator()(AnimationUtils.java:307)
at com.android.internal.policy.DecorView.<init>()(DecorView.java:237)
at com.android.internal.policy.PhoneWindow.generateDecor()(PhoneWindow.java:2281)
at com.android.internal.policy.PhoneWindow.installDecor()(PhoneWindow.java:2617)
at com.android.internal.policy.PhoneWindow.getDecorView()(PhoneWindow.java:2047)
at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor()(AppCompatDelegateImplV9.java:367)
at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor()(AppCompatDelegateImplV9.java:316)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView()(AppCompatDelegateImplV9.java:281)
at android.support.v7.app.AppCompatDialog.setContentView()(AppCompatDialog.java:80)
at android.support.v7.app.AlertController.installContent()(AlertController.java:214)
at android.support.v7.app.AlertDialog.onCreate()(AlertDialog.java:257)
at android.app.Dialog.dispatchOnCreate()(Dialog.java:389)
at android.app.Dialog.show()(Dialog.java:293)
at com.medbridgeed.core.etc.ErrorDialog$1.run()(ErrorDialog.java:64)
at android.os.Handler.handleCallback()(Handler.java:751)
at android.os.Handler.dispatchMessage()(Handler.java:95)
at android.os.Looper.loop()(Looper.java:154)
at android.app.ActivityThread.main()(ActivityThread.java:6088)
at java.lang.reflect.Method.invoke()(Method.java:-2)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run()(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main()(ZygoteInit.java:776)
UPDATE: Since I don't have easy access to a Pixel or Android 7 device, I took the time to upgrade a Nexus 5 with a custom ROM with 7.1.1. The app works fine on this device, even in split screen mode, so I'm still at a loss for why some devices are reporting this error.