Phonegap应用程序在运行时崩溃

当我尝试从模拟器和物理设备运行我的应用程序时崩溃,inheritance人日志

我有phone.0ap 1.3.0 🙂

01-12 14:13:51.742: W/dalvikvm(344): threadid=1: thread exiting with uncaught exception (group=0x40015560) 01-12 14:13:51.791: E/AndroidRuntime(344): FATAL EXCEPTION: main 01-12 14:13:51.791: E/AndroidRuntime(344): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.philipslighting.roadlight/com.philipslighting.roadlight.PhilipsRoadlightFinalActivity}: java.lang.ClassNotFoundException: com.philipslighting.roadlight.PhilipsRoadlightFinalActivity in loader dalvik.system.PathClassLoader[/data/app/com.philipslighting.roadlight-1.apk] 01-12 14:13:51.791: E/AndroidRuntime(344): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569) 01-12 14:13:51.791: E/AndroidRuntime(344): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 01-12 14:13:51.791: E/AndroidRuntime(344): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 01-12 14:13:51.791: E/AndroidRuntime(344): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 01-12 14:13:51.791: E/AndroidRuntime(344): at android.os.Handler.dispatchMessage(Handler.java:99) 01-12 14:13:51.791: E/AndroidRuntime(344): at android.os.Looper.loop(Looper.java:123) 01-12 14:13:51.791: E/AndroidRuntime(344): at android.app.ActivityThread.main(ActivityThread.java:3683) 01-12 14:13:51.791: E/AndroidRuntime(344): at java.lang.reflect.Method.invokeNative(Native Method) 01-12 14:13:51.791: E/AndroidRuntime(344): at java.lang.reflect.Method.invoke(Method.java:507) 01-12 14:13:51.791: E/AndroidRuntime(344): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 01-12 14:13:51.791: E/AndroidRuntime(344): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 01-12 14:13:51.791: E/AndroidRuntime(344): at dalvik.system.NativeStart.main(Native Method) 01-12 14:13:51.791: E/AndroidRuntime(344): Caused by: java.lang.ClassNotFoundException: com.philipslighting.roadlight.PhilipsRoadlightFinalActivity in loader dalvik.system.PathClassLoader[/data/app/com.philipslighting.roadlight-1.apk] 01-12 14:13:51.791: E/AndroidRuntime(344): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240) 01-12 14:13:51.791: E/AndroidRuntime(344): at java.lang.ClassLoader.loadClass(ClassLoader.java:551) 01-12 14:13:51.791: E/AndroidRuntime(344): at java.lang.ClassLoader.loadClass(ClassLoader.java:511) 01-12 14:13:51.791: E/AndroidRuntime(344): at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 01-12 14:13:51.791: E/AndroidRuntime(344): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561) 01-12 14:13:51.791: E/AndroidRuntime(344): ... 11 more 01-12 14:13:51.821: W/ActivityManager(61): Force finishing activity com.philipslighting.roadlight/.PhilipsRoadlightFinalActivity 01-12 14:13:52.341: W/ActivityManager(61): Activity pause timeout for HistoryRecord{4053ec18 com.philipslighting.roadlight/.PhilipsRoadlightFinalActivity} 01-12 14:13:53.151: I/Process(328): Sending signal. PID: 328 SIG: 9 01-12 14:13:53.181: I/ActivityManager(61): Process com.roadlight.philips (pid 328) has died. 01-12 14:13:54.331: I/Process(344): Sending signal. PID: 344 SIG: 9 01-12 14:13:54.371: W/InputManagerService(61): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@405c2d80 01-12 14:13:54.621: I/ActivityManager(61): Process com.philipslighting.roadlight (pid 344) has died. 

这是我的android清单:

               

如果您在活动标签中导入手机缺口活动吗?

提前致谢 !

您已经使用本教程http://phonegap.com/start#android然后修复java.lang.ClassNotFoundException ,如上所示,您需要选中“订单和导出”选项卡中cordova-XXX.jar旁边的框然后您在“配置构建路径”的“库”选项卡中为cordova-XXX.jar添加依赖项。

当然,mainclass的名称在android:name="

"
必须正确。

我正在关注phonegap机器人入门指南在我的情况下,我创建了一个名为lib而不是libs的文件夹。 这种情况的一个症状是我必须手动将jar添加到构建路径。 我从构建路径中删除了jar,将lib文件夹重命名为libs并立即开始工作。

在活动中,您导入PhoneGap的文件,请检查它。 并查看您文件夹中的index.html文件。

我想只需遵循这条道路: http : //phonegap.com/start#android

看,video你会find解决方案。

        

你应该在’activity’标签中提及包名和主类名,请看下面的例子:

机器人:名字= “com.philipslighting.roadlight.MainActivity”