0

有人可以解释一下这个 Android Volley 错误,如果可能的话,可以为我提供一个解决方案。先感谢您。

E/Volley: [3997] NetworkDispatcher.processRequest: Unhandled exception java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
                                                                          java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
                                                                              at java.net.URLEncoder.encode(URLEncoder.java:205)
                                                                              at com.android.volley.Request.encodeParameters(Request.java:491)
                                                                              at com.android.volley.Request.getBody(Request.java:477)
                                                                              at com.android.volley.toolbox.HurlStack.addBodyIfExists(HurlStack.java:245)
                                                                              at com.android.volley.toolbox.HurlStack.setConnectionParametersForRequest(HurlStack.java:219)
                                                                              at com.android.volley.toolbox.HurlStack.executeRequest(HurlStack.java:97)
                                                                              at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:131)
                                                                              at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:120)
                                                                              at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:87)
4

1 回答 1

0
NullPointerException

意味着您的一些变量null在运行时。问题不在 Volley 库中。

于 2018-05-28T11:00:40.347 回答