We got a crash log from Google Play and it seems some drawable in drawable-xhdpi-v4 is not found. However, we didn't have a drawable-xhdpi-v4 folder and do have edit_bg.9.png in res/drawable-xhdpi/. I found this post after searching, but it seems not helpful and no accepted answers there.
Thanks for any advice.
Caused by: android.content.res.Resources$NotFoundException: File res/drawable-xhdpi-v4/edit_bg.9.png from drawable resource ID #0x7f0200bb
at android.content.res.Resources.loadDrawable(Resources.java:2172)
at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
at android.view.View.<init>(View.java:3589)
at android.widget.TextView.<init>(TextView.java:642)
at android.widget.EditText.<init>(EditText.java:60)
at android.widget.EditText.<init>(EditText.java:56)
... 29 more
Caused by: java.io.FileNotFoundException: res/drawable-xhdpi-v4/edit_bg.9.png
at android.content.res.AssetManager.openNonAssetNative(Native Method)
at android.content.res.AssetManager.openNonAsset(AssetManager.java:421)
at android.content.res.Resources.loadDrawable(Resources.java:2163)
... 34 more
Related
I find the method is reanme to callDrawGLFunction2 at the android version of 5.1.0 . And add the class of com.android.webview.chromium.WebViewDelegateFactory at the same time.
But i don't know how to fix the bug. can anyone have idea.
full stack:
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
... 25 more
Caused by: android.util.AndroidRuntimeException: java.lang.RuntimeException: Invalid reflection
at android.webkit.WebViewFactory.getProvider(WebViewFactory.java)
at android.webkit.WebView.getFactory(WebView.java)
at android.webkit.WebView.ensureProviderCreated(WebView.java)
at android.webkit.WebView.setOverScrollMode(WebView.java)
at android.view.View.init(View.java)
at android.view.View.init(View.java)
at android.view.ViewGroup.init(ViewGroup.java)
at android.widget.AbsoluteLayout.init(AbsoluteLayout.java)
at android.webkit.WebView.init(WebView.java)
at android.webkit.WebView.init(WebView.java)
at android.webkit.WebView.init(WebView.java)
at android.webkit.WebView.init(WebView.java)
... 27 more
Caused by: java.lang.RuntimeException: Invalid reflection
at com.android.webview.chromium.WebViewDelegateFactory$Api21CompatibilityDelegate.init(WebViewDelegateFactory.java:258)
at com.android.webview.chromium.WebViewChromiumFactoryProvider.init(WebViewChromiumFactoryProvider.java:2106)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.Class.newInstance(Class.java:1690)
... 39 more
Caused by: java.lang.NoSuchMethodException: callDrawGLFunction [long]
at java.lang.Class.getMethod(Class.java:671)
at com.android.webview.chromium.WebViewDelegateFactory$Api21CompatibilityDelegate.init(WebViewDelegateFactory.java:246)
... 42 more
android.view.InflateException: Binary XML file line #21: Error inflating class android.webkit.WebView
at android.view.LayoutInflater.createView(LayoutInflater.java)
It's not application error.
The bug is all report from the device of sdk 22. But the method is already rename in that version.
I send email to google developer who rename the method from callDrawGLFunction to callDrawGLFunction2. I got some reply:
"Api21CompatibilityDelegate means webview believes it's running on 21. Renaming callDrawGLFunction happened after API21, hence webview is trying look for the old name."
So It's obvious device rom bug.
guys.I got a crash becasue of "java.io.FileNotFoundException: res/drawable-xhdpi-v4/component_tip_loading1.png".
But I unziped my apk and found the resource is existed.
And my build.gradle set minifyEnabled is true, but not set the shrinkResources.
Thanks for any advice.
Caused by: java.io.FileNotFoundException: res/drawable-xhdpi-v4/component_tip_loading1.png
at android.content.res.AssetManager.openNonAssetNative(Native Method)
at android.content.res.AssetManager.openNonAsset(AssetManager.java:405)
at android.content.res.Resources.loadDrawableForCookie(Resources.java:2443)
Apologies if this is a duplicate, I did try and find any similar answers first and failed as nothing seemed to refer to ImageView? I'm not an Android dev, but we are seeing issues with our app on older OS versions!
Stack trace:
02-20 09:56:15.885 11529-11529/com.octer E/AndroidRuntime﹕ FATAL EXCEPTION: main
android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x7f010076 a=2}
at android.content.res.Resources.loadDrawable(Resources.java:2063)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.view.View.<init>(View.java:3364)
at android.widget.ImageView.<init>(ImageView.java:121)
at android.widget.ImageButton.<init>(ImageButton.java:87)
at com.android.internal.view.menu.ActionMenuPresenter$OverflowMenuButton.<init>(ActionMenuPresenter.java:556)
at com.android.internal.view.menu.ActionMenuPresenter.initForMenu(ActionMenuPresenter.java:99)
at com.android.internal.view.menu.MenuBuilder.addMenuPresenter(MenuBuilder.java:216)
at com.android.internal.widget.ActionBarView.configPresenters(ActionBarView.java:483)
at com.android.internal.widget.ActionBarView.setMenu(ActionBarView.java:448)
at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:405)
at com.android.internal.policy.impl.PhoneWindow.doInvalidatePanelMenu(PhoneWindow.java:775)
at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:198)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
I did discover this post on the internet but none of the solutions seems to have fixed anything. The problem is the code builds and runs on Nexus 5, but not on older model phones.
Debug resource not found website
For all those interested, our issue was resolved when removing the following parent attribute, from one of our tags:
parent="#style/Widget.AppCompat.ActionButton.Overflow"
It's a pretty horrendous stack-trace, which didn't resolve to any logical location - we managed to isolate it after many hours of (Delete, build, delete, build...etc)
<style name="OcterActionBarOverflowButton">
Hope this helps!
I fixed this error by moving my drawable from
app\src\main\res\drawable-v24
to
app\src\main\res\drawable
We've seen about 40 of these crashes in the past two days of our app release for 4.0. After reviewing crash logs, we've discovered it's existence since version 3.3 of our app. We have been unable to reproduce this in house.
Further research has indicated this problem is prevalent in other applications, but I was unable to find a resolution or an indication that Google is aware of the issue.
The crash itself happens on the setContentView(R.layout.foo) method call in onCreate()
Notes:
We limit our API to version 4 and target 15.
We've seen this on at least 2.2 - 4.0.3 on mdpi,hdpi,xhdpi phones and tablets.
User comments specify that the app crashes immediately (expected) and that the Evernote icon in the application launcher turns to the default app icon (cannot read any drawables).
The crash is not limited to one specific drawable, we have seen many different ones in the logs, however they all "seem" to be image drawables, not colors, layouts, xml files, etc...
This is not limited to 9patches, it has happened on both regular .png and .9.png
Our drawable folders look like the picture attached
We store only xml in our drawable folder
Stack trace:
android.content.res.Resources$NotFoundException: File res/drawable/ics_tab_title_unselected.xml from drawable resource ID #0x7f02016f
at android.content.res.Resources.loadDrawable(Resources.java:1697)
at android.content.res.Resources.getDrawable(Resources.java:581)
at android.view.View.setBackgroundResource(View.java:7533)
at com.evernote.ics.ActionBarTabbedTitle.a(ActionBarTabbedTitle.java:103)
at com.evernote.ics.j.a(ActivityActionBar.java:150)
at com.evernote.ics.a.c(ActionBar.java:731)
at com.evernote.ics.a.p(ActionBar.java:440)
at com.evernote.ics.a.g(ActionBar.java:423)
at com.evernote.ics.j.m(ActivityActionBar.java:68)
at com.evernote.ics.phone.SwipeableTabbedActivityAbstract.s(SwipeableTabbedActivityAbstract.java:990)
at com.evernote.ics.phone.SwipeableTabbedActivityAbstract.a(SwipeableTabbedActivityAbstract.java:662)
at com.evernote.ics.phone.SwipeableTabbedActivityAbstract.b(SwipeableTabbedActivityAbstract.java:617)
at com.evernote.ics.phone.PhoneMainActivity.b(PhoneMainActivity.java:113)
at com.evernote.ui.EvernoteFragment.a(EvernoteFragment.java:136)
at com.evernote.ui.EvernoteFragment.a(EvernoteFragment.java:132)
at com.evernote.ui.EvernoteFragment.d(EvernoteFragment.java:128)
at com.evernote.ics.phone.b.onItemClick(HomeFragment.java:1324)
at android.widget.AdapterView.performItemClick(AdapterView.java:284)
at android.widget.ListView.performItemClick(ListView.java:3513)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:1812)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3683)
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:864)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.content.res.Resources$NotFoundException: File res/drawable-xhdpi-v4/tab_unselected_focus.9.png from drawable resource ID #0x7f0201e6
at android.content.res.Resources.loadDrawable(Resources.java:1714)
at android.content.res.Resources.getDrawable(Resources.java:581)
at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:162)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:787)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:728)
at android.content.res.Resources.loadDrawable(Resources.java:1694)
... 28 more
Caused by: java.io.FileNotFoundException: res/drawable-xhdpi-v4/tab_unselected_focus.9.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 more
Any recommendations would greatly be appreciated.
App: https://play.google.com/store/apps/details?id=com.evernote
Thanks,
Ty
similar error solved by adding the following in the "proguard" file.
-keepclassmembers class **.R$* {
public static <fields>;
}
The app works fine on HPDI and MDPI, but when run in an LDPI (v2.0) emulator, I get the exception and stack trace below.
Why is it looking for this image? (it's not referenced in my application, I've checked). The starter activity has disabled the title bar in any case.
If the OS expects this image, why is it not present?
Why is the exception relating to an MPDI image, when the emulator is LDPI?
04-20 11:35:19.432: ERROR/AndroidRuntime(236): Uncaught handler: thread main exiting due to uncaught exception
04-20 11:35:19.502: ERROR/AndroidRuntime(236): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.spondle/com.spondle.EventsActivity}: android.view.InflateException: Binary XML file line #14: Error inflating class <unknown>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2454)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2470)
at android.app.ActivityThread.access$2200(ActivityThread.java:119)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4310)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #14: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:513)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
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:198)
at android.app.Activity.setContentView(Activity.java:1622)
at com.spondle.EventsActivity.onCreate(EventsActivity.java:38)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at android.widget.ImageView.<init>(ImageView.java:105)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
at android.view.LayoutInflater.createView(LayoutInflater.java:500)
... 23 more
Caused by: android.content.res.Resources$NotFoundException: File res/drawable-mdpi/title_bar_shadow.9.png from drawable resource ID #0x7f02002a
at android.content.res.Resources.loadDrawable(Resources.java:1710)
at android.content.res.TypedArray.getDrawable(TypedArray.java:548)
at android.widget.ImageView.<init>(ImageView.java:115)
... 27 more
Caused by: java.io.FileNotFoundException: res/drawable-mdpi/title_bar_shadow.9.png
at android.content.res.AssetManager.openNonAssetNative(Native Method)
at android.content.res.AssetManager.openNonAsset(AssetManager.java:391)
at android.content.res.Resources.loadDrawable(Resources.java:1702)
... 29 more
If the OS expects this image, why is it not present?
Why is the exception relating to an MPDI image, when the emulator is LDPI?
If the requested resource (title_bar_shadow.9.png) is not present in drawable-ldpi (and it wasn't until Android 2.3), Android will try to find the best match (drawable-mdpi will be the next folder to search in). Anyway, the file will not be found there either (again, it was not there until Android 2.3). So the next step would be to search for it in drawable-hdpi (where it can be found). But apparently the search stops on drawable-mdpi (which is strange... maybe a bug in Android 2.1? you could try Android 2.2 emulator)
Why is it looking for this image? (it's not referenced in my application, I've checked). The starter activity has disabled the title bar in any case.
This image (shadow) is not used by the title bar. It is displayed UNDER the title bar.
To make it disappear, you have to create your own theme, like this:
<style
name="Theme"
parent="android:Theme.NoTitleBar">
<item
name="android:windowContentOverlay">#null</item>
</style>
I solved this problem making a copy of the images from drawable-ldpi/mdip/hdpi to a drawable (only drawable) folder. Put in this folder your low resolution images.
You don't need to have a title_bar_shadow.9.png file on these folders.