解析器(4324):解析数据时出错org.json.JSONException:未知类型java.lang.String的值无法转换为JSONObject

时间:2014-03-19 10:50:09

标签: java php android mysql json

我正在尝试设置应用程序以连接到外部数据库,以便我可以推送 数据,我决定使用以下教程(链接如下)。我复制并粘贴了代码并完成了设置,我能够将数据推送到我的数据库但由于标题中的Logcat错误而无法拉动。

提前感谢您的帮助。

http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/

    03-06 16:53:15.395: E/JSON Parser(4324): Error parsing data org.json.JSONException: Value Unknown of type java.lang.String cannot be converted to JSONObject
    03-06 16:53:15.405: I/Choreographer(4324): Skipped 32 frames!  The application may be doing too much work on its main thread.
    03-06 16:53:15.585: D/All Products:(4324): {"message":"Product successfully created.","success":1}
    03-06 16:53:15.655: W/System.err(4324): org.json.JSONException: No value for products
    03-06 16:53:15.725: W/System.err(4324):     at org.json.JSONObject.get(JSONObject.java:354)
    03-06 16:53:15.725: W/System.err(4324):     at org.json.JSONObject.getJSONArray(JSONObject.java:548)
    03-06 16:53:15.766: W/System.err(4324):     at com.example.androidhive.AllProductsActivity$LoadAllProducts.doInBackground(AllProductsActivity.java:132)
    03-06 16:53:15.795: W/System.err(4324):     at com.example.androidhive.AllProductsActivity$LoadAllProducts.doInBackground(AllProductsActivity.java:1)
    03-06 16:53:15.795: W/System.err(4324):     at android.os.AsyncTask$2.call(AsyncTask.java:287)
    03-06 16:53:15.865: W/System.err(4324):     at java.util.concurrent.FutureTask.run(FutureTask.java:234)
    03-06 16:53:15.865: W/System.err(4324):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
    03-06 16:53:15.865: W/System.err(4324):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
    03-06 16:53:15.875: W/System.err(4324):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
    03-06 16:53:15.875: W/System.err(4324):     at java.lang.Thread.run(Thread.java:841)
    03-06 16:53:15.965: I/Choreographer(4324): Skipped 32 frames!  The application may be doing too much work on its main thread.
    03-06 16:53:16.105: I/Choreographer(4324): Skipped 34 frames!  The application may be doing too much work on its main thread.

0 个答案:

没有答案