Android 未捕获异常
我在平板电脑中安装了我的应用程序并且它可以工作,但是当我尝试在手机中安装我的应用程序时,此错误显示在 logcat 中,我不知道是什么原因导致的,有人遇到过这个吗?
01-03 13:38:12.657: W/dalvikvm(2719): threadid=3: thread exiting with uncaught exception (group=0x4001e170)
01-03 13:38:12.657: E/AndroidRuntime(2719): Uncaught handler: thread main exiting due to uncaught exception
01-03 13:38:12.767: E/AndroidRuntime(2719): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.traininghandouts.app/com.traininghandouts.app.Login}: android.view.InflateException: Binary XML file line #48: Error inflating class <unknown>
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.os.Handler.dispatchMessage(Handler.java:99)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.os.Looper.loop(Looper.java:123)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.app.ActivityThread.main(ActivityThread.java:4363)
01-03 13:38:12.767: E/AndroidRuntime(2719): at java.lang.reflect.Method.invokeNative(Native Method)
01-03 13:38:12.767: E/AndroidRuntime(2719): at java.lang.reflect.Method.invoke(Method.java:521)
01-03 13:38:12.767: E/AndroidRuntime(2719): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
01-03 13:38:12.767: E/AndroidRuntime(2719): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
01-03 13:38:12.767: E/AndroidRuntime(2719): at dalvik.system.NativeStart.main(Native Method)
01-03 13:38:12.767: E/AndroidRuntime(2719): Caused by: android.view.InflateException: Binary XML file line #48: Error inflating class <unknown>
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
01-03 13:38:12.767: E/AndroidRuntime(2719): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
01-03 13:38:12.767: E/AndroidRuntime(2719): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.app.Activity.setContentView(Activity.java:1622)
01-03 13:38:12.767: E/AndroidRuntime(2719): at com.traininghandouts.app.Login.onCreate(Login.java:74)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
01-03 13:38:12.767: E/AndroidRuntime(2719): ... 11 more
01-03 13:38:12.767: E/AndroidRuntime(2719): Caused by: java.lang.reflect.InvocationTargetException
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.widget.ImageView.<init>(ImageView.java:105)
01-03 13:38:12.767: E/AndroidRuntime(2719): at java.lang.reflect.Constructor.constructNative(Native Method)
01-03 13:38:12.767: E/AndroidRuntime(2719): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.view.LayoutInflater.createView(LayoutInflater.java:500)
01-03 13:38:12.767: E/AndroidRuntime(2719): ... 22 more
01-03 13:38:12.767: E/AndroidRuntime(2719): Caused by: java.lang.StackOverflowError
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.AssetManager.getResourceValue(AssetManager.java:186)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.getValue(Resources.java:887)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.getDrawable(Resources.java:579)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:160)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:788)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.loadDrawable(Resources.java:1690)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.getDrawable(Resources.java:580)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:160)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:788)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.loadDrawable(Resources.java:1690)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.getDrawable(Resources.java:580)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:160)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:788)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.loadDrawable(Resources.java:1690)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.getDrawable(Resources.java:580)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:160)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:788)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.loadDrawable(Resources.java:1690)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.getDrawable(Resources.java:580)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.StateListDrawable.inflate(S
我应该怎么做才能解决这个问题?
i installed my app in a tablet and it works but when i tried to install my app in my phone this errors shows up in the logcat and i don't know what causes it, anyone encountered this?
01-03 13:38:12.657: W/dalvikvm(2719): threadid=3: thread exiting with uncaught exception (group=0x4001e170)
01-03 13:38:12.657: E/AndroidRuntime(2719): Uncaught handler: thread main exiting due to uncaught exception
01-03 13:38:12.767: E/AndroidRuntime(2719): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.traininghandouts.app/com.traininghandouts.app.Login}: android.view.InflateException: Binary XML file line #48: Error inflating class <unknown>
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.os.Handler.dispatchMessage(Handler.java:99)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.os.Looper.loop(Looper.java:123)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.app.ActivityThread.main(ActivityThread.java:4363)
01-03 13:38:12.767: E/AndroidRuntime(2719): at java.lang.reflect.Method.invokeNative(Native Method)
01-03 13:38:12.767: E/AndroidRuntime(2719): at java.lang.reflect.Method.invoke(Method.java:521)
01-03 13:38:12.767: E/AndroidRuntime(2719): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
01-03 13:38:12.767: E/AndroidRuntime(2719): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
01-03 13:38:12.767: E/AndroidRuntime(2719): at dalvik.system.NativeStart.main(Native Method)
01-03 13:38:12.767: E/AndroidRuntime(2719): Caused by: android.view.InflateException: Binary XML file line #48: Error inflating class <unknown>
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
01-03 13:38:12.767: E/AndroidRuntime(2719): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
01-03 13:38:12.767: E/AndroidRuntime(2719): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.app.Activity.setContentView(Activity.java:1622)
01-03 13:38:12.767: E/AndroidRuntime(2719): at com.traininghandouts.app.Login.onCreate(Login.java:74)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
01-03 13:38:12.767: E/AndroidRuntime(2719): ... 11 more
01-03 13:38:12.767: E/AndroidRuntime(2719): Caused by: java.lang.reflect.InvocationTargetException
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.widget.ImageView.<init>(ImageView.java:105)
01-03 13:38:12.767: E/AndroidRuntime(2719): at java.lang.reflect.Constructor.constructNative(Native Method)
01-03 13:38:12.767: E/AndroidRuntime(2719): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.view.LayoutInflater.createView(LayoutInflater.java:500)
01-03 13:38:12.767: E/AndroidRuntime(2719): ... 22 more
01-03 13:38:12.767: E/AndroidRuntime(2719): Caused by: java.lang.StackOverflowError
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.AssetManager.getResourceValue(AssetManager.java:186)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.getValue(Resources.java:887)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.getDrawable(Resources.java:579)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:160)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:788)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.loadDrawable(Resources.java:1690)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.getDrawable(Resources.java:580)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:160)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:788)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.loadDrawable(Resources.java:1690)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.getDrawable(Resources.java:580)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:160)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:788)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.loadDrawable(Resources.java:1690)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.getDrawable(Resources.java:580)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:160)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:788)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.loadDrawable(Resources.java:1690)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.content.res.Resources.getDrawable(Resources.java:580)
01-03 13:38:12.767: E/AndroidRuntime(2719): at android.graphics.drawable.StateListDrawable.inflate(S
what should i do to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
两条痕迹,1)XML Inflater 2)Stackoverflow 表明,您的应用程序中有太多嵌套视图(android 对此没有很好的支持)。请参阅此讨论以了解更多详细信息。stackoverflow 错误
您可能需要重新考虑您的视图组层次结构。
Two traces, 1) XML Inflater 2) Stackoverflow suggesting, you have too many nested views in your app (which is not well supported by android). Please see this discussion for more details.stackoverflow error
You may need to reconsider your view group hierarchy.