gpt4 book ai didi

android - 将 EMF 生成的 java 类集成到 Android 项目中

转载 作者:太空宇宙 更新时间:2023-11-03 10:30:35 25 4
gpt4 key购买 nike

我想知道是否可以将一组从 EMF (ecore) 模型生成的类包含到 Android 项目中。

我正在尝试这样做,它编译得很好,但在运行时出现如下错误:


06-07 11:37:04.261: INFO/dalvikvm(649): Failed resolving Lorg/mmi/events/Event; interface 318 'Lorg/eclipse/emf/ecore/EObject;'
06-07 11:37:04.261: WARN/dalvikvm(649): Link of class 'Lorg/mmi/events/Event;' failed
06-07 11:37:04.261: WARN/dalvikvm(649): VFY: unable to find class referenced in signature (Lorg/mmi/events/Event;)

像这样:


06-07 12:11:54.953: WARN/dalvikvm(721): threadid=1: thread exiting with uncaught exception (group=0x40014760)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): FATAL EXCEPTION: main
06-07 12:11:55.157: ERROR/AndroidRuntime(721): java.lang.NoClassDefFoundError: org.mmi.model.instantiator.MmiModelInstantiator
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at org.mmi.facades.MmiFacade.<init>(MmiFacade.java:30)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at com.mmi_android.instrumentation.InstrumentationContext.<init>(InstrumentationContext.java:15)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at com.mmi_android.instrumentation.InstrumentationContext.get(InstrumentationContext.java:21)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at com.example.helloandroid.HelloAndroid.onCreate(HelloAndroid.java:46)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1700)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1752)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at android.app.ActivityThread.access$1500(ActivityThread.java:123)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:993)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at android.os.Handler.dispatchMessage(Handler.java:99)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at android.os.Looper.loop(Looper.java:126)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at android.app.ActivityThread.main(ActivityThread.java:3997)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at java.lang.reflect.Method.invokeNative(Native Method)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at java.lang.reflect.Method.invoke(Method.java:491)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at dalvik.system.NativeStart.main(Native Method)

感谢您的帮助!!!

最佳答案

最后,我使用混合了 EMF 核心包的类的修改版本解决了这个问题。您可以在这里找到这些类:

论坛主题: http://dev.eclipse.org/mhonarc/lists/emf-dev/msg01001.html项目主页和存储库: http://code.google.com/p/smatrt/source/browse/#svn%2Ftrunk%2Ftmp%2Forg%253Fstate%253Dclosed

我还需要 javax.xml.* 包中包含的 XML 类。我删除了相应的注释,添加了 javax.xml jar 文件,现在所有内容都可以在 Android 中编译。

希望以后能对你有所帮助。干杯!

关于android - 将 EMF 生成的 java 类集成到 Android 项目中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6264991/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com