欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

解析android res 运行错误的问题

程序员文章站 2024-02-01 23:44:28
复制代码 代码如下:w/resourcetype(  756): failure getting entry for 0x7f020004 (t=1 e=4) i...
复制代码 代码如下:

w/resourcetype(  756): failure getting entry for 0x7f020004 (t=1 e=4) in package 0: 0xffffffb1
d/androidruntime(  756): shutting down vm
w/dalvikvm(  756): threadid=1: thread exiting with uncaught exception (group=0x2aac47c8)
e/androidruntime(  756): fatal exception: main
e/androidruntime(  756): java.lang.runtimeexception: unable to start activity componentinfo{com.xxxx.mediacenter/com.xxxx.mediacenter.video.videoplayeractivity}: android.view.inflateexception: binary xml file line #279: error inflating class <unknown>
e/androidruntime(  756): at android.app.activitythread.performlaunchactivity(activitythread.java:2663)
e/androidruntime(  756): at android.app.activitythread.handlelaunchactivity(activitythread.java:2679)
e/androidruntime(  756): at android.app.activitythread.access$2300(activitythread.java:125)
e/androidruntime(  756): at android.app.activitythread$h.handlemessage(activitythread.java:2033)
e/androidruntime(  756): at android.os.handler.dispatchmessage(handler.java:99)
e/androidruntime(  756): at android.os.looper.loop(looper.java:123)
e/androidruntime(  756): at android.app.activitythread.main(activitythread.java:4627)
e/androidruntime(  756): at java.lang.reflect.method.invokenative(native method)
e/androidruntime(  756): at java.lang.reflect.method.invoke(method.java:521)
e/androidruntime(  756): at com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:868)
e/androidruntime(  756): at com.android.internal.os.zygoteinit.main(zygoteinit.java:626)
e/androidruntime(  756): at dalvik.system.nativestart.main(native method)
e/androidruntime(  756): caused by: android.view.inflateexception: binary xml file line #279: error inflating class <unknown>
e/androidruntime(  756): at android.view.layoutinflater.createview(layoutinflater.java:513)
e/androidruntime(  756): at com.android.internal.policy.impl.phonelayoutinflater.oncreateview(phonelayoutinflater.java:56)
e/androidruntime(  756): at android.view.layoutinflater.createviewfromtag(layoutinflater.java:563)
e/androidruntime(  756): at android.view.layoutinflater.rinflate(layoutinflater.java:618)
e/androidruntime(  756): at android.view.layoutinflater.rinflate(layoutinflater.java:621)
e/androidruntime(  756): at android.view.layoutinflater.rinflate(layoutinflater.java:621)
e/androidruntime(  756): at android.view.layoutinflater.rinflate(layoutinflater.java:621)
e/androidruntime(  756): at android.view.layoutinflater.rinflate(layoutinflater.java:621)
e/androidruntime(  756): at android.view.layoutinflater.rinflate(layoutinflater.java:621)
e/androidruntime(  756): at android.view.layoutinflater.inflate(layoutinflater.java:407)
e/androidruntime(  756): at android.view.layoutinflater.inflate(layoutinflater.java:320)
e/androidruntime(  756): at android.view.layoutinflater.inflate(layoutinflater.java:276)
e/androidruntime(  756): at com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:198)
e/androidruntime(  756): at android.app.activity.setcontentview(activity.java:1647)
e/androidruntime(  756): at com.xxxx.mediacenter.video.videoplayeractivity.oncreate(videoplayeractivity.java:152)
e/androidruntime(  756): at android.app.instrumentation.callactivityoncreate(instrumentation.java:1047)
e/androidruntime(  756): at android.app.activitythread.performlaunchactivity(activitythread.java:2627)
e/androidruntime(  756): ... 11 more
e/androidruntime(  756): caused by: java.lang.reflect.invocationtargetexception
e/androidruntime(  756): at android.widget.imagebutton.<init>(imagebutton.java:78)
e/androidruntime(  756): at java.lang.reflect.constructor.constructnative(native method)
e/androidruntime(  756): at java.lang.reflect.constructor.newinstance(constructor.java:446)
e/androidruntime(  756): at android.view.layoutinflater.createview(layoutinflater.java:500)
e/androidruntime(  756): ... 27 more
e/androidruntime(  756): caused by: android.content.res.resources$notfoundexception: file res/drawable/seek_thumb.xml from drawable resource id #0x7f020004
e/androidruntime(  756): at android.content.res.resources.loaddrawable(resources.java:1697)
e/androidruntime(  756): at android.content.res.typedarray.getdrawable(typedarray.java:601)
e/androidruntime(  756): at android.widget.imageview.<init>(imageview.java:118)
e/androidruntime(  756): at android.widget.imagebutton.<init>(imagebutton.java:82)
e/androidruntime(  756): ... 31 more
e/androidruntime(  756): caused by: android.content.res.resources$notfoundexception: file res/drawable/seek_thumb.xml from xml type drawable resource id #0x7f020004
e/androidruntime(  756): at android.content.res.resources.loadxmlresourceparser(resources.java:1916)
e/androidruntime(  756): at android.content.res.resources.loaddrawable(resources.java:1692)
e/androidruntime(  756): ... 34 more
e/androidruntime(  756): caused by: java.io.filenotfoundexception: res/drawable/seek_thumb.xml
e/androidruntime(  756): at android.content.res.assetmanager.openxmlassetnative(native method)
e/androidruntime(  756): at android.content.res.assetmanager.openxmlblockasset(assetmanager.java:485)
e/androidruntime(  756): at android.content.res.resources.loadxmlresourceparser(resources.java:1898)
e/androidruntime(  756): ... 35 more
w/activitymanager(  615):   force finishing activity com.xxxx.mediacenter/.video.videoplayeractivity
w/activitymanager(  615):   force finishing activity com.xxxx.mediacenter/.center.mediacenteractivity
i/gralloc (  615): alloc:
i/gralloc (  615): usage: 0x133
i/gralloc (  615): format: 1
i/gralloc (  615): 480x232

or
复制代码 代码如下:

e/androidruntime(  758): fatal exception: main
e/androidruntime(  758): java.lang.runtimeexception: unable to start activity componentinfo{com.vixs.mediacenter/com.xxxx.mediacenter.video.videoplayeractivity}: android.content.res.resources$notfoundexception: resource id #0x7f030004
e/androidruntime(  758): at android.app.activitythread.performlaunchactivity(activitythread.java:2663)
e/androidruntime(  758): at android.app.activitythread.handlelaunchactivity(activitythread.java:2679)
e/androidruntime(  758): at android.app.activitythread.access$2300(activitythread.java:125)
e/androidruntime(  758): at android.app.activitythread$h.handlemessage(activitythread.java:2033)
e/androidruntime(  758): at android.os.handler.dispatchmessage(handler.java:99)
e/androidruntime(  758): at android.os.looper.loop(looper.java:123)
e/androidruntime(  758): at android.app.activitythread.main(activitythread.java:4627)
e/androidruntime(  758): at java.lang.reflect.method.invokenative(native method)
e/androidruntime(  758): at java.lang.reflect.method.invoke(method.java:521)
e/androidruntime(  758): at com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:868)
e/androidruntime(  758): at com.android.internal.os.zygoteinit.main(zygoteinit.java:626)
e/androidruntime(  758): at dalvik.system.nativestart.main(native method)
e/androidruntime(  758): caused by: android.content.res.resources$notfoundexception: resource id #0x7f030004
e/androidruntime(  758): at android.content.res.resources.getvalue(resources.java:892)
e/androidruntime(  758): at android.content.res.resources.loadxmlresourceparser(resources.java:1869)
e/androidruntime(  758): at android.content.res.resources.getlayout(resources.java:731)
e/androidruntime(  758): at android.view.layoutinflater.inflate(layoutinflater.java:318)
e/androidruntime(  758): at android.view.layoutinflater.inflate(layoutinflater.java:276)
e/androidruntime(  758): at com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:198)
e/androidruntime(  758): at android.app.activity.setcontentview(activity.java:1647)
e/androidruntime(  758): at com.vixs.mediacenter.video.videoplayeractivity.oncreate(videoplayeractivity.java:152)
e/androidruntime(  758): at android.app.instrumentation.callactivityoncreate(instrumentation.java:1047)
e/androidruntime(  758): at android.app.activitythread.performlaunchactivity(activitythread.java:2627)

资源都放在drawable和layout中就可以啦