Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Problem parsing the earthquake JSON results #13

Open
k0p038x opened this issue Jan 20, 2018 · 4 comments
Open

Problem parsing the earthquake JSON results #13

k0p038x opened this issue Jan 20, 2018 · 4 comments

Comments

@k0p038x
Copy link

k0p038x commented Jan 20, 2018

E/MainActivity: Problem parsing the earthquake JSON results
org.json.JSONException: End of input at character 0 of
at org.json.JSONTokener.syntaxError(JSONTokener.java:449)
at org.json.JSONTokener.nextValue(JSONTokener.java:97)
at org.json.JSONObject.(JSONObject.java:159)
at org.json.JSONObject.(JSONObject.java:176)
at com.example.android.soonami.MainActivity$TsunamiAsyncTask.extractFeatureFromJson(MainActivity.java:205)
at com.example.android.soonami.MainActivity$TsunamiAsyncTask.doInBackground(MainActivity.java:119)
at com.example.android.soonami.MainActivity$TsunamiAsyncTask.doInBackground(MainActivity.java:103)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)

@DiscoFighter47
Copy link

@writer99 it's because JSON response is empty. Did you forget to turn on wifi on your phone?

@Cs-nada
Copy link

Cs-nada commented May 8, 2018

thanks that work for me

@kkchain
Copy link

kkchain commented Aug 11, 2018

08-11 16:08:40.386 7617-7617/? I/art: Late-enabling -Xcheck:jni
08-11 16:08:40.405 7617-7623/? I/art: Debugger is no longer active
08-11 16:08:40.420 7617-7617/? W/System: ClassLoader referenced unknown path: /data/app/com.example.android.quakereport-1/lib/arm
08-11 16:08:40.486 7617-7617/? E/QueryUtils: Problem parsing the earthquake JSON results
org.json.JSONException: No value for location
at org.json.JSONObject.get(JSONObject.java:389)
at org.json.JSONObject.getString(JSONObject.java:550)
at com.example.android.quakereport.QueryUtils.extractEarthquakes(QueryUtils.java:60)
at com.example.android.quakereport.EarthquakeActivity.onCreate(EarthquakeActivity.java:35)
at android.app.Activity.performCreate(Activity.java:6251)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
08-11 16:08:40.493 7617-7639/? D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
08-11 16:08:40.533 7617-7639/? I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 10/21/15, 369a2ea, I96aee987eb
08-11 16:08:40.534 7617-7639/? I/OpenGLRenderer: Initialized EGL, version 1.4

@kkchain
Copy link

kkchain commented Aug 11, 2018

any advice, seems not work for me. thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants