膨胀异常

发布于 2024-12-06 15:31:38 字数 4200 浏览 0 评论 0原文

我一直遇到 InflateException 错误,但不太确定它的含义。我希望有人能给我解释一下。谢谢。下面是堆栈跟踪。

09-26 17:35:29.747: ERROR/AndroidRuntime(10214): Uncaught handler: thread main exiting due to uncaught exception
09-26 17:35:30.072: ERROR/AndroidRuntime(10214): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.comp.something/com.project.something.something.android.SomethingActivity}: android.view.InflateException: Binary XML file line #15: Error inflating class com.project.something.something.android
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.os.Handler.dispatchMessage(Handler.java:99)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.os.Looper.loop(Looper.java:123)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread.main(ActivityThread.java:4363)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at java.lang.reflect.Method.invokeNative(Native Method)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at java.lang.reflect.Method.invoke(Method.java:521)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at dalvik.system.NativeStart.main(Native Method)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214): Caused by: android.view.InflateException: Binary XML file line #15: Error inflating class com.project.something.something.android
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.Activity.setContentView(Activity.java:1631)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at com.project.something.something.android.SomethingActivity.onCreate(SomethingActivity.java:48)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     ... 11 more
09-26 17:35:30.072: ERROR/AndroidRuntime(10214): Caused by: java.lang.ClassNotFoundException:com.project.something.something.android in loader dalvik.system.PathClassLoader@4803c918
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.createView(LayoutInflater.java:466)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)

I've been encountering and InflateException error and am not really sure what it means. I hope someone can explain it to me. Thanks. Below is the stack trace.

09-26 17:35:29.747: ERROR/AndroidRuntime(10214): Uncaught handler: thread main exiting due to uncaught exception
09-26 17:35:30.072: ERROR/AndroidRuntime(10214): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.comp.something/com.project.something.something.android.SomethingActivity}: android.view.InflateException: Binary XML file line #15: Error inflating class com.project.something.something.android
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.os.Handler.dispatchMessage(Handler.java:99)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.os.Looper.loop(Looper.java:123)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread.main(ActivityThread.java:4363)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at java.lang.reflect.Method.invokeNative(Native Method)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at java.lang.reflect.Method.invoke(Method.java:521)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at dalvik.system.NativeStart.main(Native Method)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214): Caused by: android.view.InflateException: Binary XML file line #15: Error inflating class com.project.something.something.android
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.Activity.setContentView(Activity.java:1631)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at com.project.something.something.android.SomethingActivity.onCreate(SomethingActivity.java:48)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     ... 11 more
09-26 17:35:30.072: ERROR/AndroidRuntime(10214): Caused by: java.lang.ClassNotFoundException:com.project.something.something.android in loader dalvik.system.PathClassLoader@4803c918
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.createView(LayoutInflater.java:466)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

各空 2024-12-13 15:31:38

您似乎想使用 setContentView()onCreate() 方法中设置布局。布局引用第 5 行中名为 com.project.something.something.android 的类。我猜想该类不存在,因此布局无法膨胀。

It seems you want to set a layout in your onCreate() method using setContentView(). The layout refers to a class in line #5 that is named com.project.something.something.android. I guess the class doesn't exist and so the layout couldn't be inflated.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文