0

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

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Dan Belden
  • 1,199
  • 1
  • 9
  • 20
  • `nothing seemed to refer to ImageView?` a Drawable isn't only an image. It can refer to an animation, a shape, a statelist selector, ... And it's not only appliable to `ImageViews`, but to **ANY** `View`. In your case, `at android.widget.ImageButton.(ImageButton.java:87)`. You are possibly using a `system resource` which is not present in older OS versions. – Phantômaxx Feb 20 '15 at 10:15
  • I'd presumed the stack trace inferred this issue has likely derived from a faulty definition? I'm not going to take any Android hats away from anyone here, I'm a back-end dev playing at mobile de-bugging. Any pointers would be appreciated... --- at android.widget.ImageView.(ImageView.java:121) – Dan Belden Feb 20 '15 at 10:18
  • 1
    `at android.widget.ImageButton.(ImageButton.java:87)` ImageView is part of the ImageButton that caused the issue. It really seems that the cause is the overflow button of your ActionBar: `at com.android.internal.view.menu.ActionMenuPresenter$OverflowMenuButton.(ActionMenuPresenter.java:556)`. Your search field has now been narrowed quite a bit. – Phantômaxx Feb 20 '15 at 10:25
  • I'm getting the same issue reported through analytics. The device is always Lenovo TAB S8-50F. Did you find a solution? I assume its to do with the Overflow button resource, perhaps not present on certain devices. Unfortunately we don't own the model to test with. – kassim Mar 06 '15 at 16:00
  • Answers here: https://stackoverflow.com/questions/29095063/resourcesnotfoundexception-resource-is-not-a-drawable-color-or-path – user8256287 Aug 12 '17 at 03:02

2 Answers2

5

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!

Dan Belden
  • 1,199
  • 1
  • 9
  • 20
1

I fixed this error by moving my drawable from

app\src\main\res\drawable-v24

to

app\src\main\res\drawable

Adhiambo Oyier
  • 215
  • 1
  • 11