2012-02-23 28 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”,但可能应该是“警觉”。