在android中运行PhoneGap应用程序

时间:2014-09-15 04:46:08

标签: cordova

我是PhoneGap Development的新手。我已经将phonegap安装到我的系统中,并且我尝试在android模拟器中运行测试应用程序( Hello World应用程序)。一切顺利,我得到了构建成功消息,它正在使用模拟器(模拟器-5554 ),我的终端中也有启动成功消息但是当我在模拟器中检查时,我看不到我的应用程序而不是显示不幸的是HeeloWorld应用程序已停止

任何人都可以请指导我为什么会这样,以及为什么我的应用程序没有在模拟器中显示。

更新

This is output from my logcat:

09-15 04:58:30.010: D/dalvikvm(1057): Not late-enabling CheckJNI (already on)
09-15 04:58:30.530: I/CordovaLog(1057): Changing log level to DEBUG(3)
09-15 04:58:30.530: I/CordovaLog(1057): Found start page location: index.html
09-15 04:58:30.530: D/Whitelist(1057): Unlimited access to network resources
09-15 04:58:30.530: D/CordovaActivity(1057): CordovaActivity.onCreate()
09-15 04:58:31.020: E/WebViewFactory(1057): Chromium WebView does not exist
09-15 04:58:31.040: E/WebViewFactory(1057): Chromium WebView does not exist
09-15 04:58:31.040: D/AndroidRuntime(1057): Shutting down VM
09-15 04:58:31.040: W/dalvikvm(1057): threadid=1: thread exiting with uncaught exception (group=0xb3a7dd70)
09-15 04:58:31.140: E/AndroidRuntime(1057): FATAL EXCEPTION: main
09-15 04:58:31.140: E/AndroidRuntime(1057): Process: com.example.hello, PID: 1057
09-15 04:58:31.140: E/AndroidRuntime(1057): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.hello/com.example.hello.HelloWorld}: java.lang.UnsupportedOperationException
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2197)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.app.ActivityThread.access$800(ActivityThread.java:138)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.os.Handler.dispatchMessage(Handler.java:102)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.os.Looper.loop(Looper.java:136)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.app.ActivityThread.main(ActivityThread.java:5026)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at java.lang.reflect.Method.invokeNative(Native Method)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at java.lang.reflect.Method.invoke(Method.java:515)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at dalvik.system.NativeStart.main(Native Method)
09-15 04:58:31.140: E/AndroidRuntime(1057): Caused by: java.lang.UnsupportedOperationException
09-15 04:58:31.140: E/AndroidRuntime(1057):     at com.android.webview.nullwebview.NullWebViewFactoryProvider.createWebView(NullWebViewFactoryProvider.java:41)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.webkit.WebView.ensureProviderCreated(WebView.java:2058)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.webkit.WebView.setOverScrollMode(WebView.java:2116)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.view.View.<init>(View.java:3461)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.view.View.<init>(View.java:3517)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.view.ViewGroup.<init>(ViewGroup.java:470)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.widget.AbsoluteLayout.<init>(AbsoluteLayout.java:52)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.webkit.WebView.<init>(WebView.java:498)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.webkit.WebView.<init>(WebView.java:475)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.webkit.WebView.<init>(WebView.java:455)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.webkit.WebView.<init>(WebView.java:444)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.webkit.WebView.<init>(WebView.java:434)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at org.apache.cordova.CordovaWebView.<init>(CordovaWebView.java:137)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at org.apache.cordova.CordovaActivity.makeWebView(CordovaActivity.java:272)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:307)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at com.example.hello.HelloWorld.onCreate(HelloWorld.java:31)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.app.Activity.performCreate(Activity.java:5242)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
09-15 04:58:31.140: E/AndroidRuntime(1057):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
09-15 04:58:31.140: E/AndroidRuntime(1057):     ... 11 more

1 个答案:

答案 0 :(得分:2)

我通过将AVD的目标更改为Android 4.4.2 API Level 19来解决我的问题,然后它现在工作正常。

希望这可以帮助某人