java.lang.NoClassDefFoundError:android

时间:2017-04-12 05:46:32

标签: java android

我在Android中面临以下问题。

  

致命的例外:主要                                                                   处理:pkg.demo,PID:22090                                                                   java.lang.NoClassDefFoundError:java.awt.Image                                                                       at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl。(RuntimeBuiltinLeafInfoImpl.java:372)                                                                       at com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl。(RuntimeTypeInfoSetImpl.java:65)                                                                       at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:133)                                                                       at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:85)                                                                       在com.sun.xml.bind.v2.model.impl.ModelBuilder。(ModelBuilder.java:156)                                                                       在com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder。(RuntimeModelBuilder.java:93)                                                                       at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:455)                                                                       在com.sun.xml.bind.v2.runtime.JAXBContextImpl。(JAXBContextImpl.java:303)                                                                       在com.sun.xml.bind.v2.runtime.JAXBContextImpl。(JAXBContextImpl.java:142)                                                                       at com.sun.xml.bind.v2.runtime.JAXBContextImpl $ JAXBContextBuilder.build(JAXBContextImpl.java:1174)                                                                       at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:162)                                                                       at java.lang.reflect.Method.invokeNative(Native Method)                                                                       在java.lang.reflect.Method.invoke(Method.java:515)                                                                       在javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:202)                                                                       在javax.xml.bind.ContextFinder.find(ContextFinder.java:363)                                                                       在javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)                                                                       在javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)

1 个答案:

答案 0 :(得分:0)

问题的原因在于例外的第一行:

  

FATAL EXCEPTION:main进程:pkg.demo,PID:22090 java.lang.NoClassDefFoundError:java.saw.xml.vind.vodem.model.impl.RuntimeBuiltinLeafInfoImpl的java.awt.Image。

Android无法找到班级java.awt.Image。这是因为Image是一个AWT类; AWT是Android中不存在的工具包。

此错误源自com.sun.xml.bind.v2.modle.impl.RuntimeBuiltinLeafInfoImpl。所以,似乎你已经添加了一个依赖于AWT的库。

解决方案是查看此库是否已移植到Android;然后使用Android端口 如果没有端口,则必须找到另一个库。