在提供实时网站IP地址时出错

时间:2017-05-22 04:10:56

标签: java android android-studio debugging android-permissions

我正在开发一个项目,它已经完成,测试也在本地完成,但是当我给他一个网站地址时,它会给我以下错误,请帮助理解这些错误。

FATAL EXCEPTION: main
 Process: rahul.sidd, PID: 1107
 com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 2 path $
     at com.google.gson.Gson.fromJson(Gson.java:899)
     at com.google.gson.Gson.fromJson(Gson.java:852)
     at com.google.gson.Gson.fromJson(Gson.java:801)
     at com.kosalgeek.android.json.JsonConverter.toArrayList(JsonConverter.java:42)
     at praveen.siddharthsocialservices.MainActivity$6.processFinish(MainActivity.java:385)
     at com.kosalgeek.genasync12.PostResponseAsyncTask.onPostExecute(PostResponseAsyncTask.java:252)
     at com.kosalgeek.genasync12.PostResponseAsyncTask.onPostExecute(PostResponseAsyncTask.java:33)
     at android.os.AsyncTask.finish(AsyncTask.java:632)
     at android.os.AsyncTask.access$600(AsyncTask.java:177)
     at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
     at android.os.Handler.dispatchMessage(Handler.java:106)
     at android.os.Looper.loop(Looper.java:189)
     at android.app.ActivityThread.main(ActivityThread.java:5528)
     at java.lang.reflect.Method.invoke(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:372)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
  Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 2 path $
     at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
     at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
     at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
     at com.google.gson.Gson.fromJson(Gson.java:887)
     at com.google.gson.Gson.fromJson(Gson.java:852) 
     at com.google.gson.Gson.fromJson(Gson.java:801) 
     at com.kosalgeek.android.json.JsonConverter.toArrayList(JsonConverter.java:42) 
     at praveen.siddharthsocialservices.MainActivity$6.processFinish(MainActivity.java:385) 
     at com.kosalgeek.genasync12.PostResponseAsyncTask.onPostExecute(PostResponseAsyncTask.java:252) 
     at com.kosalgeek.genasync12.PostResponseAsyncTask.onPostExecute(PostResponseAsyncTask.java:33) 
     at android.os.AsyncTask.finish(AsyncTask.java:632) 
     at android.os.AsyncTask.access$600(AsyncTask.java:177) 
     at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645) 
     at android.os.Handler.dispatchMessage(Handler.java:106) 
     at android.os.Looper.loop(Looper.java:189) 
     at android.app.ActivityThread.main(ActivityThread.java:5528) 
     at java.lang.reflect.Method.invoke(Native Method) 
     at java.lang.reflect.Method.invoke(Method.java:372) 
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950) 
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745) 
05-22 09:31:28.960 630-630/? E/WifiTrafficPoller: TRAFFIC_STATS_POLL true Token 667 num clients 12   

1 个答案:

答案 0 :(得分:0)

我发现了这个问题,我的一个对象获得空引用,这就是为什么我收到此问题而我的应用程序崩溃了。谢谢你的回复。