使用Eclipse + Android + Phonegap生成apk

时间:2013-07-09 01:03:52

标签: java android eclipse cordova

项目正常工作,生成大约400 kb的apk。

它必须重新安装eclipse并再次生成工作区,项目正确编译。生成文件apk但有200kb。运行模拟器时出错:

“应用程序X意外停止。请重试”。

Logcat显示以下内容:

07-09 00:51:51.332: E/AndroidRuntime(219): Uncaught handler: thread main exiting due to uncaught exception
07-09 00:51:51.351: E/AndroidRuntime(219): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mobilesoftware.rankingd/com.mobilesoftware.rankingd.MainActivity}: java.lang.ClassNotFoundException: com.mobilesoftware.rankingd.MainActivity in loader dalvik.system.PathClassLoader@44e8c3b0
07-09 00:51:51.351: E/AndroidRuntime(219):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
07-09 00:51:51.351: E/AndroidRuntime(219):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
07-09 00:51:51.351: E/AndroidRuntime(219):  at android.app.ActivityThread.access$2200(ActivityThread.java:119)
07-09 00:51:51.351: E/AndroidRuntime(219):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
07-09 00:51:51.351: E/AndroidRuntime(219):  at android.os.Handler.dispatchMessage(Handler.java:99)
07-09 00:51:51.351: E/AndroidRuntime(219):  at android.os.Looper.loop(Looper.java:123)
07-09 00:51:51.351: E/AndroidRuntime(219):  at android.app.ActivityThread.main(ActivityThread.java:4363)
07-09 00:51:51.351: E/AndroidRuntime(219):  at java.lang.reflect.Method.invokeNative(Native Method)
07-09 00:51:51.351: E/AndroidRuntime(219):  at java.lang.reflect.Method.invoke(Method.java:521)
07-09 00:51:51.351: E/AndroidRuntime(219):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-09 00:51:51.351: E/AndroidRuntime(219):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-09 00:51:51.351: E/AndroidRuntime(219):  at dalvik.system.NativeStart.main(Native Method)
07-09 00:51:51.351: E/AndroidRuntime(219): Caused by: java.lang.ClassNotFoundException: com.mobilesoftware.rankingd.MainActivity in loader dalvik.system.PathClassLoader@44e8c3b0
07-09 00:51:51.351: E/AndroidRuntime(219):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
07-09 00:51:51.351: E/AndroidRuntime(219):  at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
07-09 00:51:51.351: E/AndroidRuntime(219):  at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
07-09 00:51:51.351: E/AndroidRuntime(219):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
07-09 00:51:51.351: E/AndroidRuntime(219):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
07-09 00:51:51.351: E/AndroidRuntime(219):  ... 11 more

有什么想法找到解决问题的方法吗? 谢谢!

1 个答案:

答案 0 :(得分:0)

图书馆未被链接。转到“项目>属性> Android”。底部应该有一个框,列出了哪些库链接。我会假设你有一个红色的X.您需要删除并重新添加库到项目中。