android.content.res。资源$NotFoundException:资源不是可绘制的(颜色或路径):TypedValue{t=0x2/d=0x7f010076 a=2}

时间:2022-11-21 12:25:11

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!

抱歉,如果这是重复的,我确实试过先找到任何类似的答案,但失败了,因为似乎没有什么是ImageView?我不是Android开发人员,但是我们看到我们的应用在旧的操作系统版本上有问题!

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.

我确实在网上找到了这篇文章,但没有一个解决方案似乎能解决任何问题。问题是代码是在Nexus 5上构建和运行的,而不是在老款手机上。

Debug resource not found website

调试资源未找到网站

1 个解决方案

#1


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!

希望这可以帮助!

#1


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!

希望这可以帮助!