我有下文中我的日志猫每当我试图将我的 android 应用程序连接到 mysql 使用 php 和 json 解析器错误。任何人都可以在这方面帮我吗?
12-26 06:07:23.222: D/gralloc_goldfish(766): Emulator without GPU emulation detected.
12-26 06:09:34.332: D/dalvikvm(766): GC_FOR_ALLOC freed 89K, 7% free 2794K/3004K, paused 155ms, total 176ms
12-26 06:09:34.402: I/dalvikvm-heap(766): Grow heap (frag case) to 3.447MB for 635812-byte allocation
12-26 06:09:34.642: D/dalvikvm(766): GC_FOR_ALLOC freed 6K, 7% free 3409K/3628K, paused 245ms, total 245ms
12-26 06:09:35.592: I/Choreographer(766): Skipped 50 frames! The application may be doing too much work on its main thread.
12-26 06:09:36.102: I/Choreographer(766): Skipped 109 frames! The application may be doing too much work on its main thread.
12-26 06:09:36.532: I/Choreographer(766): Skipped 91 frames! The application may be doing too much work on its main thread.
12-26 06:09:37.062: I/Choreographer(766): Skipped 103 frames! The application may be doing too much work on its main thread.
12-26 06:09:38.064: I/Choreographer(766): Skipped 54 frames! The application may be doing too much work on its main thread.
12-26 06:09:38.332: I/Choreographer(766): Skipped 36 frames! The application may be doing too much work on its main thread.
12-26 06:09:38.552: I/Choreographer(766): Skipped 56 frames! The application may be doing too much work on its main thread.
12-26 06:09:40.784: E/JSON Parser(766): Error parsing data org.json.JSONException: Value Unknown of type java.lang.String cannot be converted to JSONObject
12-26 06:09:40.872: W/dalvikvm(766): threadid=11: thread exiting with uncaught exception (group=0x41465700)
12-26 06:09:41.032: E/AndroidRuntime(766): FATAL EXCEPTION: AsyncTask #1
12-26 06:09:41.032: E/AndroidRuntime(766): java.lang.RuntimeException: An error occured while executing doInBackground()
12-26 06:09:41.032: E/AndroidRuntime(766): at android.os.AsyncTask$3.done(AsyncTask.java:299)
12-26 06:09:41.032: E/AndroidRuntime(766): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
12-26 06:09:41.032: E/AndroidRuntime(766): at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
12-26 06:09:41.032: E/AndroidRuntime(766): at java.util.concurrent.FutureTask.run(FutureTask.java:239)
12-26 06:09:41.032: E/AndroidRuntime(766): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
12-26 06:09:41.032: E/AndroidRuntime(766): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
12-26 06:09:41.032: E/AndroidRuntime(766): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
12-26 06:09:41.032: E/AndroidRuntime(766): at java.lang.Thread.run(Thread.java:841)
12-26 06:09:41.032: E/AndroidRuntime(766): Caused by: java.lang.NullPointerException
12-26 06:09:41.032: E/AndroidRuntime(766): at com.example.androidhive.AllProductsActivity$LoadAllProducts.doInBackground(AllProductsActivity.java:108)
12-26 06:09:41.032: E/AndroidRuntime(766): at com.example.androidhive.AllProductsActivity$LoadAllProducts.doInBackground(AllProductsActivity.java:1)
12-26 06:09:41.032: E/AndroidRuntime(766): at android.os.AsyncTask$2.call(AsyncTask.java:287)
12-26 06:09:41.032: E/AndroidRuntime(766): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
12-26 06:09:41.032: E/AndroidRuntime(766): ... 4 more
12-26 06:09:42.514: I/Choreographer(766): Skipped 262 frames! The application may be doing too much work on its main thread.
12-26 06:09:42.684: I/Choreographer(766): Skipped 44 frames! The application may be doing too much work on its main thread.
12-26 06:09:42.992: I/Choreographer(766): Skipped 77 frames! The application may be doing too much work on its main thread.
12-26 06:09:43.602: I/Choreographer(766): Skipped 159 frames! The application may be doing too much work on its main thread.
12-26 06:09:44.852: E/WindowManager(766): Activity com.example.androidhive.AllProductsActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{417251e8 V.E..... R.....ID 0,0-480,144} that was originally added here
12-26 06:09:44.852: E/WindowManager(766): android.view.WindowLeaked: Activity com.example.androidhive.AllProductsActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{417251e8 V.E..... R.....ID 0,0-480,144} that was originally added here
12-26 06:09:44.852: E/WindowManager(766): at android.view.ViewRootImpl.<init>(ViewRootImpl.java:345)
12-26 06:09:44.852: E/WindowManager(766): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:239)
12-26 06:09:44.852: E/WindowManager(766): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
12-26 06:09:44.852: E/WindowManager(766): at android.app.Dialog.show(Dialog.java:281)
12-26 06:09:44.852: E/WindowManager(766): at com.example.androidhive.AllProductsActivity$LoadAllProducts.onPreExecute(AllProductsActivity.java:96)
12-26 06:09:44.852: E/WindowManager(766): at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:586)
12-26 06:09:44.852: E/WindowManager(766): at android.os.AsyncTask.execute(AsyncTask.java:534)
12-26 06:09:44.852: E/WindowManager(766): at com.example.androidhive.AllProductsActivity.onCreate(AllProductsActivity.java:50)
12-26 06:09:44.852: E/WindowManager(766): at android.app.Activity.performCreate(Activity.java:5133)
12-26 06:09:44.852: E/WindowManager(766): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
12-26 06:09:44.852: E/WindowManager(766): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
12-26 06:09:44.852: E/WindowManager(766): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
12-26 06:09:44.852: E/WindowManager(766): at android.app.ActivityThread.access$600(ActivityThread.java:141)
12-26 06:09:44.852: E/WindowManager(766): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
12-26 06:09:44.852: E/WindowManager(766): at android.os.Handler.dispatchMessage(Handler.java:99)
12-26 06:09:44.852: E/WindowManager(766): at android.os.Looper.loop(Looper.java:137)
12-26 06:09:44.852: E/WindowManager(766): at android.app.ActivityThread.main(ActivityThread.java:5103)
12-26 06:09:44.852: E/WindowManager(766): at java.lang.reflect.Method.invokeNative(Native Method)
12-26 06:09:44.852: E/WindowManager(766): at java.lang.reflect.Method.invoke(Method.java:525)
12-26 06:09:44.852: E/WindowManager(766): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
12-26 06:09:44.852: E/WindowManager(766): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-26 06:09:44.852: E/WindowManager(766): at dalvik.system.NativeStart.main(Native Method)
12-26 06:09:44.922: I/Choreographer(766): Skipped 82 frames! The application may be doing too much work on its main thread.
12-26 06:09:46.183: I/Process(766): Sending signal. PID: 766 SIG: 9
12-26 06:53:08.933: D/gralloc_goldfish(1056): Emulator without GPU emulation detected.
12-26 06:53:15.462: D/dalvikvm(1056): GC_FOR_ALLOC freed 79K, 7% free 2794K/2992K, paused 187ms, total 224ms
12-26 06:53:15.492: I/dalvikvm-heap(1056): Grow heap (frag case) to 3.447MB for 635812-byte allocation
12-26 06:53:15.702: D/dalvikvm(1056): GC_FOR_ALLOC freed 6K, 6% free 3409K/3616K, paused 208ms, total 208ms
12-26 06:53:16.672: I/Choreographer(1056): Skipped 34 frames! The application may be doing too much work on its main thread.
12-26 06:53:17.162: I/Choreographer(1056): Skipped 118 frames! The application may be doing too much work on its main thread.
12-26 06:53:17.553: I/Choreographer(1056): Skipped 74 frames! The application may be doing too much work on its main thread.
12-26 06:53:18.242: I/Choreographer(1056): Skipped 116 frames! The application may be doing too much work on its main thread.
12-26 06:53:22.182: I/Choreographer(1056): Skipped 39 frames! The application may be doing too much work on its main thread.
12-26 06:53:22.502: I/Choreographer(1056): Skipped 37 frames! The application may be doing too much work on its main thread.
12-26 06:53:22.852: I/Choreographer(1056): Skipped 41 frames! The application may be doing too much work on its main thread.
12-26 06:53:23.014: I/Choreographer(1056): Skipped 41 frames! The application may be doing too much work on its main thread.
12-26 06:53:23.292: I/Choreographer(1056): Skipped 44 frames! The application may be doing too much work on its main thread.
12-26 06:53:23.612: I/Choreographer(1056): Skipped 44 frames! The application may be doing too much work on its main thread.
12-26 06:53:23.822: E/JSON Parser(1056): Error parsing data org.json.JSONException: Value Unknown of type java.lang.String cannot be converted to JSONObject
12-26 06:53:23.822: E/JSON Parser(1056): Error parsing data org.json.JSONException: Value Unknown of type java.lang.String cannot be converted to JSONObject
12-26 06:53:23.892: W/dalvikvm(1056): threadid=11: thread exiting with uncaught exception (group=0x41465700)
12-26 06:53:23.952: I/Choreographer(1056): Skipped 32 frames! The application may be doing too much work on its main thread.
12-26 06:53:24.112: E/AndroidRuntime(1056): FATAL EXCEPTION: AsyncTask #1
12-26 06:53:24.112: E/AndroidRuntime(1056): java.lang.RuntimeException: An error occured while executing doInBackground()
12-26 06:53:24.112: E/AndroidRuntime(1056): at android.os.AsyncTask$3.done(AsyncTask.java:299)
12-26 06:53:24.112: E/AndroidRuntime(1056): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
12-26 06:53:24.112: E/AndroidRuntime(1056): at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
12-26 06:53:24.112: E/AndroidRuntime(1056): at java.util.concurrent.FutureTask.run(FutureTask.java:239)
12-26 06:53:24.112: E/AndroidRuntime(1056): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
12-26 06:53:24.112: E/AndroidRuntime(1056): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
12-26 06:53:24.112: E/AndroidRuntime(1056): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
12-26 06:53:24.112: E/AndroidRuntime(1056): at java.lang.Thread.run(Thread.java:841)
12-26 06:53:24.112: E/AndroidRuntime(1056): Caused by: java.lang.NullPointerException
12-26 06:53:24.112: E/AndroidRuntime(1056): at com.example.androidhive.AllProductsActivity$LoadAllProducts.doInBackground(AllProductsActivity.java:108)
12-26 06:53:24.112: E/AndroidRuntime(1056): at com.example.androidhive.AllProductsActivity$LoadAllProducts.doInBackground(AllProductsActivity.java:1)
12-26 06:53:24.112: E/AndroidRuntime(1056): at android.os.AsyncTask$2.call(AsyncTask.java:287)
12-26 06:53:24.112: E/AndroidRuntime(1056): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
12-26 06:53:24.112: E/AndroidRuntime(1056): ... 4 more
12-26 06:53:24.793: I/Choreographer(1056): Skipped 89 frames! The application may be doing too much work on its main thread.
12-26 06:53:25.353: I/Choreographer(1056): Skipped 117 frames! The application may be doing too much work on its main thread.
12-26 06:53:25.943: I/Choreographer(1056): Skipped 146 frames! The application may be doing too much work on its main thread.
12-26 06:53:26.693: E/WindowManager(1056): Activity com.example.androidhive.AllProductsActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{4171b938 V.E..... R.....ID 0,0-480,144} that was originally added here
12-26 06:53:26.693: E/WindowManager(1056): android.view.WindowLeaked: Activity com.example.androidhive.AllProductsActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{4171b938 V.E..... R.....ID 0,0-480,144} that was originally added here
12-26 06:53:26.693: E/WindowManager(1056): at android.view.ViewRootImpl.<init>(ViewRootImpl.java:345)
12-26 06:53:26.693: E/WindowManager(1056): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:239)
12-26 06:53:26.693: E/WindowManager(1056): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
12-26 06:53:26.693: E/WindowManager(1056): at android.app.Dialog.show(Dialog.java:281)
12-26 06:53:26.693: E/WindowManager(1056): at com.example.androidhive.AllProductsActivity$LoadAllProducts.onPreExecute(AllProductsActivity.java:96)
12-26 06:53:26.693: E/WindowManager(1056): at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:586)
12-26 06:53:26.693: E/WindowManager(1056): at android.os.AsyncTask.execute(AsyncTask.java:534)
12-26 06:53:26.693: E/WindowManager(1056): at com.example.androidhive.AllProductsActivity.onCreate(AllProductsActivity.java:50)
12-26 06:53:26.693: E/WindowManager(1056): at android.app.Activity.performCreate(Activity.java:5133)
12-26 06:53:26.693: E/WindowManager(1056): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
12-26 06:53:26.693: E/WindowManager(1056): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
12-26 06:53:26.693: E/WindowManager(1056): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
12-26 06:53:26.693: E/WindowManager(1056): at android.app.ActivityThread.access$600(ActivityThread.java:141)
12-26 06:53:26.693: E/WindowManager(1056): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
12-26 06:53:26.693: E/WindowManager(1056): at android.os.Handler.dispatchMessage(Handler.java:99)
12-26 06:53:26.693: E/WindowManager(1056): at android.os.Looper.loop(Looper.java:137)
12-26 06:53:26.693: E/WindowManager(1056): at android.app.ActivityThread.main(ActivityThread.java:5103)
12-26 06:53:26.693: E/WindowManager(1056): at java.lang.reflect.Method.invokeNative(Native Method)
12-26 06:53:26.693: E/WindowManager(1056): at java.lang.reflect.Method.invoke(Method.java:525)
12-26 06:53:26.693: E/WindowManager(1056): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
12-26 06:53:26.693: E/WindowManager(1056): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-26 06:53:26.693: E/WindowManager(1056): at dalvik.system.NativeStart.main(Native Method)
12-26 06:53:26.723: I/Choreographer(1056): Skipped 45 frames! The application may be doing too much work on its main thread.
12-26 06:53:32.992: D/gralloc_goldfish(1082): Emulator without GPU emulation detected.
解决方法 1:
您正在获取 Caused by: java.lang.NullPointerException 因为 Json 错误。
E/JSON Parser(766): Error parsing data org.json.JSONException: Value Unknown of type java.lang.String cannot be converted to JSONObject
在行号 96 查阅 &
com.example.androidhive.AllProductsActivity$LoadAllProducts.onPreExecute(AllProductsActivity.java:96)
在尝试调试您的代码,您的 JSON 对象获取它的意思是您的响应不是有效,您编写的代码或每个要求的 null。
--转自