2012-07-27 150 views
4

我正在使用eclipse indigo with android ADT 20,但每次都顯示應用程序意外停止的錯誤。
請任何人有關於如何使用它們兩個彼此的想法?
我也提到一些谷歌groupe顯示更新ecllipse,我也遵循,但仍然無法正常工作。 THX提前...Phonegap應用程序在Indigo上意外停止運行Android ADT 20

日誌:

07-27 16:48:04.958: D/ddm-heap(217): Got feature list request 
07-27 16:48:05.328: I/dalvikvm(217): Could not find method android.webkit.WebView.<init>, referenced from method org.apache.cordova.CordovaWebView.<init> 
07-27 16:48:05.328: W/dalvikvm(217): VFY: unable to resolve direct method 3114: Landroid/webkit/WebView;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;IZ)V 
07-27 16:48:05.328: D/dalvikvm(217): VFY: replacing opcode 0x70 at 0x0001 
07-27 16:48:05.328: D/dalvikvm(217): Making a copy of Lorg/apache/cordova/CordovaWebView;.<init> code (196 bytes) 
07-27 16:48:05.658: D/dalvikvm(217): GC freed 807 objects/63672 bytes in 104ms 
07-27 16:48:05.948: E/dalvikvm(217): Could not find class 'android.webkit.WebResourceResponse', referenced from method org.apache.cordova.CordovaWebViewClient.generateWebResourceResponse 
07-27 16:48:05.958: W/dalvikvm(217): VFY: unable to resolve new-instance 451 (Landroid/webkit/WebResourceResponse;) in Lorg/apache/cordova/CordovaWebViewClient; 
07-27 16:48:05.958: D/dalvikvm(217): VFY: replacing opcode 0x22 at 0x0046 
07-27 16:48:05.958: D/dalvikvm(217): Making a copy of Lorg/apache/cordova/CordovaWebViewClient;.generateWebResourceResponse code (245 bytes) 
07-27 16:48:05.958: W/dalvikvm(217): VFY: unable to find class referenced in signature (Landroid/webkit/WebResourceResponse;) 
07-27 16:48:05.998: W/dalvikvm(217): VFY: unable to find class referenced in signature (Landroid/webkit/WebResourceResponse;) 
07-27 16:48:06.014: W/dalvikvm(217): VFY: unable to find class referenced in signature (Landroid/webkit/WebResourceResponse;) 
07-27 16:48:06.014: I/dalvikvm(217): Could not find method android.webkit.WebViewClient.shouldInterceptRequest, referenced from method org.apache.cordova.CordovaWebViewClient.shouldInterceptRequest 
07-27 16:48:06.014: W/dalvikvm(217): VFY: unable to resolve virtual method 3125: Landroid/webkit/WebViewClient;.shouldInterceptRequest (Landroid/webkit/WebView;Ljava/lang/String;)Landroid/webkit/WebResourceResponse; 
07-27 16:48:06.014: D/dalvikvm(217): VFY: replacing opcode 0x6f at 0x0015 
07-27 16:48:06.014: D/dalvikvm(217): Making a copy of Lorg/apache/cordova/CordovaWebViewClient;.shouldInterceptRequest code (68 bytes) 
07-27 16:48:06.018: W/dalvikvm(217): VFY: unable to find class referenced in signature (Landroid/webkit/ConsoleMessage;) 
07-27 16:48:06.018: I/dalvikvm(217): Could not find method android.webkit.ConsoleMessage.message, referenced from method org.apache.cordova.CordovaChromeClient.onConsoleMessage 
07-27 16:48:06.018: W/dalvikvm(217): VFY: unable to resolve virtual method 3084: Landroid/webkit/ConsoleMessage;.message()Ljava/lang/String; 
07-27 16:48:06.018: D/dalvikvm(217): VFY: replacing opcode 0x6e at 0x0000 
07-27 16:48:06.028: D/dalvikvm(217): Making a copy of Lorg/apache/cordova/CordovaChromeClient;.onConsoleMessage code (56 bytes) 
07-27 16:48:06.038: W/System.err(217): ===================================================================================== 
07-27 16:48:06.056: W/System.err(217): ERROR: plugin.xml is missing. Add res/xml/plugins.xml to your project. 
07-27 16:48:06.056: W/System.err(217): https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.git;a=blob;f=framework/res/xml/plugins.xml 
07-27 16:48:06.056: W/System.err(217): ===================================================================================== 
07-27 16:48:06.056: W/ResourceType(217): No package identifier when getting name for resource number 0x00000000 
07-27 16:48:06.058: D/AndroidRuntime(217): Shutting down VM 
07-27 16:48:06.058: W/dalvikvm(217): threadid=3: thread exiting with uncaught exception (group=0x4001b188) 
07-27 16:48:06.058: E/AndroidRuntime(217): Uncaught handler: thread main exiting due to uncaught exception 
07-27 16:48:06.078: E/AndroidRuntime(217): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.testdemo/com.example.testdemo.MainActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x0 
07-27 16:48:06.078: E/AndroidRuntime(217): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496) 
07-27 16:48:06.078: E/AndroidRuntime(217): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 
07-27 16:48:06.078: E/AndroidRuntime(217): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 
07-27 16:48:06.078: E/AndroidRuntime(217): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 
07-27 16:48:06.078: E/AndroidRuntime(217): at android.os.Handler.dispatchMessage(Handler.java:99) 
07-27 16:48:06.078: E/AndroidRuntime(217): at android.os.Looper.loop(Looper.java:123) 
07-27 16:48:06.078: E/AndroidRuntime(217): at android.app.ActivityThread.main(ActivityThread.java:4363) 
07-27 16:48:06.078: E/AndroidRuntime(217): at java.lang.reflect.Method.invokeNative(Native Method) 
07-27 16:48:06.078: E/AndroidRuntime(217): at java.lang.reflect.Method.invoke(Method.java:521) 
07-27 16:48:06.078: E/AndroidRuntime(217): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 
07-27 16:48:06.078: E/AndroidRuntime(217): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 
07-27 16:48:06.078: E/AndroidRuntime(217): at dalvik.system.NativeStart.main(Native Method) 
07-27 16:48:06.078: E/AndroidRuntime(217): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0 
07-27 16:48:06.078: E/AndroidRuntime(217): at android.content.res.Resources.getValue(Resources.java:891) 
07-27 16:48:06.078: E/AndroidRuntime(217): at android.content.res.Resources.loadXmlResourceParser(Resources.java:1865) 
07-27 16:48:06.078: E/AndroidRuntime(217): at android.content.res.Resources.getXml(Resources.java:779) 
07-27 16:48:06.078: E/AndroidRuntime(217): at org.apache.cordova.api.PluginManager.loadPlugins(PluginManager.java:99) 
07-27 16:48:06.078: E/AndroidRuntime(217): at org.apache.cordova.api.PluginManager.init(PluginManager.java:76) 
07-27 16:48:06.078: E/AndroidRuntime(217): at org.apache.cordova.CordovaWebView.loadUrlIntoView(CordovaWebView.java:361) 
07-27 16:48:06.078: E/AndroidRuntime(217): at org.apache.cordova.CordovaWebView.loadUrl(CordovaWebView.java:314) 
07-27 16:48:06.078: E/AndroidRuntime(217): at org.apache.cordova.DroidGap.loadUrl(DroidGap.java:356) 
07-27 16:48:06.078: E/AndroidRuntime(217): at com.example.testdemo.MainActivity.onCreate(MainActivity.java:12) 
07-27 16:48:06.078: E/AndroidRuntime(217): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 
07-27 16:48:06.078: E/AndroidRuntime(217): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459) 
07-27 16:48:06.078: E/AndroidRuntime(217): ... 11 more 
07-27 16:48:06.098: I/dalvikvm(217): threadid=7: reacting to signal 3 
07-27 16:48:06.098: E/dalvikvm(217): Unable to open stack trace file '/data/anr/traces.txt': Permission denied 
07-27 16:48:08.998: I/Process(217): Sending signal. PID: 217 SIG: 9 
+1

日誌?????????????????? – 2012-07-27 10:12:17

+0

最初使用哪個ADT版本? – 2012-07-27 10:56:21

+0

請檢查日誌,並給我的解決方案,如果你有... – 2012-07-27 10:56:36

回答

2

出現此問題的原因「LIB」文件夾是由Android的人改名爲「庫」現在。 您需要創建一個libs文件夾而不是lib,然後將cordova.jar文件放在那裏。 只要我們將外部罐子放到這個「libs」文件夾中,它就會自動添加到應用程序的構建路徑中。然後運行你的應用程序.... 讓我知道,如果這有助於你...

+0

之後,它不會顯示未捕獲的異常,但仍然顯示錯誤anroid.content.res.Resources $ NotFoundException:資源編號爲0x0 – 2012-07-27 11:08:51

+0

先清理它...,並確保所有的外部庫在libs文件夾中...如果仍然出現錯誤,請將此新日誌粘貼到此處.... – 2012-07-27 11:13:19

+0

上述問題將更新新日誌... – 2012-07-27 11:20:14

1

你應該嘗試調試您的構建。看到這裏:http://www.droidnova.com/debugging-in-android-using-eclipse,541.html

我會建議下載android sdk示例(即本機代碼示例)並運行它們以瞭解android如何工作。這將幫助你設置phonegap(這只是一個帶有JS本地橋接的android應用程序中的web視圖)。

要獲取Android SDK中的例子,你可以下載他們通過Android「SDK管理器」

+0

其實我嘗試了一個,但日誌沒有顯示任何錯誤,但我一直懷疑Android ADT 20和phonegap 2.0的兼容性 – 2012-07-27 10:25:19

+0

我有1.6我認爲。它適用於ADT20。嘗試通過DDMS獲取堆棧跟蹤。看到這個:http://www.barebonescoder.com/2010/07/using-ddms-to-profile-android-apps/ – Dessus 2012-07-27 10:29:57

+0

實際上,在更新我的ADT之前,所有phonegap應用程序都能正常工作,但在ADT 20之後它顯示錯誤。 – 2012-07-27 10:43:46