起初在log 日志中只能够看到 java.lang.NullPointerException:Attempt to invoke virtual method 'int okhttp3.Response.code()' on a null object reference异常提示,并且因为bug显示不容易复现,导致问题很长的时间都不能够有效的解决,最后再看bugly的错误日志中得到答案,有了上面截图的错误提示,百度查到解决方法,希望能够成功,
解决方法:
build.gradle中引入下面这句:
implementation ‘org.apache.httpcomponents:httpclient-android:4.3.5’
引用网址:https://blog.csdn.net/qq_35500233/article/details/103562797