Open YYYSSSHHH opened 4 years ago
We have admittedly not touched the Android app in some time. All of the project members have moved onto other projects.
If you'd like to fork this project, please feel free. We recommend replacing the Android app shell that we had in place - the current version is extremely outdated.
If you do fork, please remember to respect our licenses and credit where it is due
Environment Info: MaterialIOS :android:versionCode="10" android:versionName="2.1" AndroidOS Version = “6.0.1”
Description information: We find that mobile apps are prone to crashes due to a network issue, mainly because successful network API calls return unexpected or no data. And we found that when this app's network returned data is null or some fields are null (JSON format), or is empty ,or the network request fails (status code is 404/503), , the app has crashed.
crash information:
crash one:
crashActivity=com.jvillalba.apod.classic.activities.MainActivity
java.lang.RuntimeException: Failed to prepare ResponseConverter for target class com.afollestad.polar.util.WallpaperUtils$WallpapersHolder: https://raw.githubusercontent.com/materialos/Illustrations/master/wallpapers.json, 404 error, error: Value error of type java.lang.String cannot be converted to JSONObject at com.afollestad.bridge.conversion.base.ResponseConverter.convertObject(ResponseConverter.java:33) at com.afollestad.bridge.Response.asClass(Response.java:203) at com.afollestad.bridge.RequestBuilder$9.response(RequestBuilder.java:495) at com.afollestad.bridge.CallbackStack$1.run(CallbackStack.java:59) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5539) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635) Caused by: com.afollestad.bridge.BridgeException: https://raw.githubusercontent.com/materialos/Illustrations/master/wallpapers.json, 404 error, error: Value error of type java.lang.String cannot be converted to JSONObject at com.afollestad.bridge.Response.asJsonObject(Response.java:157) at com.afollestad.bridge.conversion.JsonResponseConverter.onPrepare(JsonResponseConverter.java:34) at com.afollestad.bridge.conversion.base.ResponseConverter.convertObject(ResponseConverter.java:31) ... 10 more Caused by: org.json.JSONException: Value error of type java.lang.String cannot be converted to JSONObject at org.json.JSON.typeMismatch(JSON.java:111) at org.json.JSONObject.(JSONObject.java:160)
at org.json.JSONObject.(JSONObject.java:173)
at com.afollestad.bridge.Response.asJsonObject(Response.java:154)
... 12 more
com.afollestad.bridge.BridgeException: https://raw.githubusercontent.com/materialos/Illustrations/master/wallpapers.json, 404 error, error: Value error of type java.lang.String cannot be converted to JSONObject
at com.afollestad.bridge.Response.asJsonObject(Response.java:157)
at com.afollestad.bridge.conversion.JsonResponseConverter.onPrepare(JsonResponseConverter.java:34)
at com.afollestad.bridge.conversion.base.ResponseConverter.convertObject(ResponseConverter.java:31)
at com.afollestad.bridge.Response.asClass(Response.java:203)
at com.afollestad.bridge.RequestBuilder$9.response(RequestBuilder.java:495)
at com.afollestad.bridge.CallbackStack$1.run(CallbackStack.java:59)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5539)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)
Caused by: org.json.JSONException: Value error of type java.lang.String cannot be converted to JSONObject
at org.json.JSON.typeMismatch(JSON.java:111)
at org.json.JSONObject.(JSONObject.java:160)
at org.json.JSONObject.(JSONObject.java:173)
at com.afollestad.bridge.Response.asJsonObject(Response.java:154)
... 12 more
org.json.JSONException: Value error of type java.lang.String cannot be converted to JSONObject
at org.json.JSON.typeMismatch(JSON.java:111)
at org.json.JSONObject.(JSONObject.java:160)
at org.json.JSONObject.(JSONObject.java:173)
at com.afollestad.bridge.Response.asJsonObject(Response.java:154)
at com.afollestad.bridge.conversion.JsonResponseConverter.onPrepare(JsonResponseConverter.java:34)
at com.afollestad.bridge.conversion.base.ResponseConverter.convertObject(ResponseConverter.java:31)
at com.afollestad.bridge.Response.asClass(Response.java:203)
at com.afollestad.bridge.RequestBuilder$9.response(RequestBuilder.java:495)
at com.afollestad.bridge.CallbackStack$1.run(CallbackStack.java:59)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5539)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)
crashActivity=com.jvillalba.apod.classic.activities.MainActivity
: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equalsIgnoreCase(java.lang.String)' on a null object reference at com.jvillalba.apod.classic.adapter.MyAdapter.addAll(MyAdapter.java:32) at com.jvillalba.apod.classic.controller.NasaController$1.onResponse(NasaController.java:30) at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:70) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5539) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)
crashActivity=com.jvillalba.apod.classic.activities.MainActivity
:java.lang.IllegalArgumentException: Path must not be empty. at com.squareup.picasso.Picasso.load(Picasso.java:297) at com.jvillalba.apod.classic.adapter.MyAdapter$ViewHolder.bind(MyAdapter.java:84) at com.jvillalba.apod.classic.adapter.MyAdapter.onBindViewHolder(MyAdapter.java:59) at com.jvillalba.apod.classic.adapter.MyAdapter.onBindViewHolder(MyAdapter.java:18) at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6482) at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6515) at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5458) at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5724) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5563) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5559) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2229) at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1556) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1516) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:608) at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3693) at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3410) at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3962) at android.view.View.layout(View.java:16636) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079) at android.view.View.layout(View.java:16636) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16636) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.support.v7.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:443) at android.view.View.layout(View.java:16636) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16636) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586) at android.widget.LinearLayout.onLayout(LinearLayout.java:1495) at android.view.View.layout(View.java:16636) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678) at android.view.View.layout(View.java:16636) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2165) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1925) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6007) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) at android.view.Choreographer.doCallbacks(Choreographer.java:670) at android.view.Choreographer.doFrame(Choreographer.java:606) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5539) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)
Finally: The cause of the program crash may be that the network response data is not handled properly in the code. If you have confirmed or fixed this problem, please give me a reply, thank you!