2012-02-23 69 views
0

即時通訊與我的項目有這個問題。我不知道該怎麼做。請幫幫我。這裏是應用程序的運行logcat中通過模擬器2.2Android開發錯誤,使用Eclipse

02-23 07:48:27.474: I/PhoneGapLog(274): Changing log level to DEBUG(3) 
02-23 07:48:27.474: D/DroidGap(274): DroidGap.onCreate() 
02-23 07:48:27.485: D/DroidGap(274): DroidGap.init() 
02-23 07:48:27.653: D/DroidGap(274): DroidGap.loadUrl(file:///android_asset/www/index.html, 9000) 
02-23 07:48:27.693: D/SoftKeyboardDetect(274): Ignore this event 
02-23 07:48:27.804: D/SoftKeyboardDetect(274): Ignore this event 
02-23 07:48:36.753: D/DroidGap(274): DroidGap.loadUrl(file:///android_asset/www/index.html) 
02-23 07:48:36.753: D/DroidGap(274): DroidGap: url=file:///android_asset/www/index.html baseUrl=file:///android_asset/www/ 
02-23 07:48:37.245: D/dalvikvm(274): GC_FOR_MALLOC freed 2060 objects/177440 bytes in 140ms 
02-23 07:48:37.423: D/dalvikvm(274): GC_FOR_MALLOC freed 1065 objects/68792 bytes in 55ms 
02-23 07:48:39.503: I/Database(274): sqlite returned: error code = 14, msg = cannot open file at source line 25467 
02-23 07:48:40.154: E/Contact Query(274): Value {"birthday":null,"ims":null,"nickname":null,"rawId":null,"urls":null,"organizations":null,"emails":null,"phoneNumbers":null,"photos":null,"id":null,"name":{"middleName":null,"familyName":null,"formatted":"","givenName":"","honorificSuffix":null,"honorificPrefix":null},"categories":null,"addresses":null,"displayName":null,"note":null} at 0 of type org.json.JSONObject cannot be converted to JSONArray 
02-23 07:48:40.154: E/Contact Query(274): org.json.JSONException: Value {"birthday":null,"ims":null,"nickname":null,"rawId":null,"urls":null,"organizations":null,"emails":null,"phoneNumbers":null,"photos":null,"id":null,"name":{"middleName":null,"familyName":null,"formatted":"","givenName":"","honorificSuffix":null,"honorificPrefix":null},"categories":null,"addresses":null,"displayName":null,"note":null} at 0 of type org.json.JSONObject cannot be converted to JSONArray 
02-23 07:48:40.154: E/Contact Query(274): at org.json.JSON.typeMismatch(JSON.java:96) 
02-23 07:48:40.154: E/Contact Query(274): at org.json.JSONArray.getJSONArray(JSONArray.java:459) 
02-23 07:48:40.154: E/Contact Query(274): at com.phonegap.ContactManager.execute(ContactManager.java:87) 
02-23 07:48:40.154: E/Contact Query(274): at com.phonegap.api.PluginManager$1.run(PluginManager.java:150) 
02-23 07:48:40.154: E/Contact Query(274): at java.lang.Thread.run(Thread.java:1096) 
02-23 07:48:40.543: D/PhoneGapLog(274): Error in error callback: Contacts2 = ReferenceError: Can't find variable: elert 
02-23 07:48:40.543: D/PhoneGapLog(274): file:///android_asset/www/phonegap-1.4.1.js: Line 717 : Error in error callback: Contacts2 = ReferenceError: Can't find variable: elert 
02-23 07:48:40.543: I/Web Console(274): Error in error callback: Contacts2 = ReferenceError: Can't find variable: elert at file:///android_asset/www/phonegap-1.4.1.js:717 
02-23 07:48:42.493: D/dalvikvm(274): GC_FOR_MALLOC freed 3339 objects/726120 bytes in 158ms 

回答

0

這是一個有點亂碼...你可以編輯你的問題,包裝在一個代碼塊的東西,給它一些新行?剛開始時我看到很多PhoneGap的東西,也許你也可以用你的帖子標記你的帖子。反正很難破譯這是怎麼回事,這是顯著錯誤等

哦,它就在那裏,給我的時間...

那麼它看起來像你試圖迫使一些單一的JSONObject到JSONArray中......這似乎是個壞消息。你可以發佈一些代碼嗎?

+0

我不知道哪個是哪個。我非常抱歉。這個項目是由我的教授提供的,他希望我在他說的那一刻就繞過登錄權限。 – 2012-02-23 00:43:02

0

這條線:

02-23 07:48:39.503: I/Database(274): sqlite returned: error code = 14, msg = cannot open file at source line 25467 

貌似有連接到數據庫中的錯誤。

這反過來又導致該錯誤行:

02-23 07:48:40.154: E/Contact Query(274): Value {"birthday":null,"ims":null,"nickname":null,"rawId":null,"urls":null,"organizations":null,"emails":null,"phoneNumbers":null,"photos":null,"id":null,"name":{"middleName":null,"familyName":null,"formatted":"","givenName":"","honorificSuffix":null,"honorificPrefix":null},"categories":null,"addresses":null,"displayName":null,"note":null} at 0 of type org.json.JSONObject cannot be converted to JSONArray 

因爲這很可能應該是從數據庫中抽取的所有值都爲空值,因此,爲什麼你的應用程序失敗。

的第一個錯誤告訴你到底是哪行代碼失敗:25467.

看看在你的項目中該行。

+0

謝謝。但無論如何,我可以繞過登錄到數據庫的那一刻?或者我應該刪除還是添加有關此項目的任何事件?謝謝 – 2012-02-23 00:56:47

+0

您必須禁用任何需要基於該登錄名的數據的方法/函數調用。你可以對它進行註釋,但是你最終會得到一個不處理代碼段的程序。 – Sorean 2012-02-23 00:59:42

+2

您可以放心地忽略那個sqlite錯誤代碼14.當您新建一個Android WebView時,您將一直得到該錯誤。 – 2012-02-23 02:49:06

0

我想我可以幫忙,如果我能看到你的HTML代碼。看起來你正在嘗試做一個navigator.contacts.find()並且它沒有返回任何結果。我注意到的另一件事是你的錯誤回調試圖執行「elert」,但可能應該是「警覺」。