Android开发错误,使用Eclipse
我的项目遇到这个问题。我不知道该怎么办。请帮我。这是模拟器 2.2 运行的应用程序的 logcat
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
im having this problem with my project. and I dont know what to do. please help me. here is the logcat for the application ran by simulator 2.2
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这有点乱码......你可以编辑你的问题,将内容包装在代码块中并给它一些换行符吗?乍一看,我看到了很多 PhoneGap 的东西,也许你也可以用它来标记你的帖子。不管怎样,很难破译发生了什么,这是一个重大错误,等等。
哦,就是这样……给我一点时间……
好吧,看起来你正试图将一些单个 JSONObject 强制到 JSONArray 中……这似乎是个坏消息。你能发布一些代码吗?
That's a a little garbled... can you edit your question, wrap the stuff in a code block and give it some newlines? Just at first blush I see a lot of PhoneGap stuff, perhaps you can tag your post with that as well. Anyway it's hard to decipher what's going on, which is the significant error, etc.
Oh there it is... give me a moment...
Well it looks like you're trying to coerce some single JSONObject into a JSONArray... which it seems is bad news. Can you post some code?
这一行:
看起来连接数据库时出错。
这又会导致此错误行:
因为可能应该从数据库中提取的所有值都是空值,因此您的应用程序失败了。
第一个错误准确地告诉您哪一行代码失败:25467。
查看项目中的该行。
This line:
Looks like there is an error connecting to the database.
Which in turn causes this error line:
Because all the values that are probably supposed to be pulled from the database are null values, and thus why your application is failing.
The first error tells you exactly which line of code is failing: 25467.
Look at that line in your project.
我想如果我能看到您的 HTML 代码,我可以提供帮助。您似乎正在尝试执行 navigator.contacts.find() 并且它没有返回任何结果。我注意到的另一件事是您的错误回调正在尝试执行“elert”,但这可能应该是“alert”。
I think I could help if I could see your HTML code. It appears that you are trying to do a navigator.contacts.find() and it isn't returning any results. The other thing I notice is your error callback is trying to execute "elert" but that probably should be "alert".