我正在尝试使用PhoneGap 来构建一个移动应用程序,尽管我想你可以弄清楚这么多。无论如何,我使用cordova CLI 工具来初始化项目,然后添加android 作为平台。之后,我将platforms/android 文件夹导入Eclipse,通过添加cordova jar 修复构建错误并单击“运行”。
模拟器启动后,我收到消息“不幸的是,HelloCordova 已停止”
以下是我得到的错误:
07-09 00:41:26.979: E/Trace(1941): error opening trace file: No such file or directory (2)
07-09 00:41:26.979: W/Trace(1941): Unexpected value from nativeGetEnabledTags: 0
07-09 00:41:26.979: W/Trace(1941): Unexpected value from nativeGetEnabledTags: 0
07-09 00:41:26.979: W/Trace(1941): Unexpected value from nativeGetEnabledTags: 0
07-09 00:41:27.129: W/Trace(1941): Unexpected value from nativeGetEnabledTags: 0
07-09 00:41:27.129: W/Trace(1941): Unexpected value from nativeGetEnabledTags: 0
07-09 00:41:27.129: W/dalvikvm(1941): Unable to resolve superclass of Lio/cordova/hellocordova/HelloCordova; (16)
07-09 00:41:27.129: W/dalvikvm(1941): Link of class 'Lio/cordova/hellocordova/HelloCordova;' failed
07-09 00:41:27.151: D/AndroidRuntime(1941): Shutting down VM
07-09 00:41:27.151: W/dalvikvm(1941): threadid=1: thread exiting with uncaught exception (group=0xb5dc0908)
07-09 00:41:27.180: E/AndroidRuntime(1941): FATAL EXCEPTION: main
07-09 00:41:27.180: E/AndroidRuntime(1941): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{io.cordova.hellocordova/io.cordova.hellocordova.HelloCordova}: java.lang.ClassNotFoundException: Didn't find class "io.cordova.hellocordova.HelloCordova" on path: /data/app/io.cordova.hellocordova-1.apk
07-09 00:41:27.180: E/AndroidRuntime(1941): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
07-09 00:41:27.180: E/AndroidRuntime(1941): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
07-09 00:41:27.180: E/AndroidRuntime(1941): at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-09 00:41:27.180: E/AndroidRuntime(1941): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
07-09 00:41:27.180: E/AndroidRuntime(1941): at android.os.Handler.dispatchMessage(Handler.java:99)
07-09 00:41:27.180: E/AndroidRuntime(1941): at android.os.Looper.loop(Looper.java:137)
07-09 00:41:27.180: E/AndroidRuntime(1941): at android.app.ActivityThread.main(ActivityThread.java:5039)
07-09 00:41:27.180: E/AndroidRuntime(1941): at java.lang.reflect.Method.invokeNative(Native Method)
07-09 00:41:27.180: E/AndroidRuntime(1941): at java.lang.reflect.Method.invoke(Method.java:511)
07-09 00:41:27.180: E/AndroidRuntime(1941): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-09 00:41:27.180: E/AndroidRuntime(1941): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-09 00:41:27.180: E/AndroidRuntime(1941): at dalvik.system.NativeStart.main(Native Method)
07-09 00:41:27.180: E/AndroidRuntime(1941): Caused by: java.lang.ClassNotFoundException: Didn't find class "io.cordova.hellocordova.HelloCordova" on path: /data/app/io.cordova.hellocordova-1.apk
07-09 00:41:27.180: E/AndroidRuntime(1941): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
07-09 00:41:27.180: E/AndroidRuntime(1941): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
07-09 00:41:27.180: E/AndroidRuntime(1941): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
07-09 00:41:27.180: E/AndroidRuntime(1941): at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
07-09 00:41:27.180: E/AndroidRuntime(1941): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
07-09 00:41:27.180: E/AndroidRuntime(1941): ... 11 more
我假设默认代码应该运行。我错过了什么吗?