Error java.lang.ClassNotFoundException, PathClassLoader.findClass() android

坚强是说给别人听的谎言 提交于 2019-12-11 05:48:27

问题


My project work ok on the emulator. But hardware show me that i make some mistake. I get something like that from stack report. I was looking for solution of this problem and i found hint to add all used libraries to manifest, but it doesn t help me anyway.

java.lang.RuntimeException: Unable to start activity ComponentInfo{your.modlitewnik/your.modlitewnik.ModlitewnikActivity}: android.view.InflateException: Binary XML file line #42: Error inflating class android.widget.Space
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1659)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
at android.app.ActivityThread.access$1500(ActivityThread.java:121)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3701)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #42: Error inflating class android.widget.Space
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
at android.app.Activity.setContentView(Activity.java:1657)
at your.modlitewnik.ModlitewnikActivity.onCreate(ModlitewnikActivity.java:15)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623)
... 11 more
Caused by: java.lang.ClassNotFoundException: android.widget.Space in loader dalvik.system.PathClassLoader[/data/app/your.modlitewnik-1.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at android.view.LayoutInflater.createView(LayoutInflater.java:471)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)

回答1:


You are trying to use an API Level 14 class, android.widget.Space, on a phone that does not support it. So unless your phone is running Ice Cream Sandwich it will not run. It probably works in your emulator because you have specified an emulator using API Level 14 or 15.



来源:https://stackoverflow.com/questions/10001610/error-java-lang-classnotfoundexception-pathclassloader-findclass-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!