We use Firebase in our app(s) so we can monitor errors that users have experienced.
Sometimes we get the error below. We can't get it reproduced.
Attempt to write to field 'anywheresoftware.b4h.okhttp.OkHttpClientWrapper$OkHttpResponse lmmobile.jds.android.httpjob._response' on a null object reference
Fatal Exception: java.lang.NullPointerException: Attempt to write to field 'anywheresoftware.b4h.okhttp.OkHttpClientWrapper$OkHttpResponse lmmobile.jds.android.httpjob._response' on a null object reference
at lmmobile.jds.android.httputils2service._hc_responseerror(httputils2service.java:209)
at java.lang.reflect.Method.invoke(Method.java)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at anywheresoftware.b4a.BA$2.run(BA.java:370)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7156)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
OkHttp ConnectionPool
at java.lang.Object.wait(Object.java)
at okhttp3.ConnectionPool$1.run(ConnectionPool.java:65)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
I see where it happens however it is not something that is "supposed" to happen. Are you doing anything special with HttpJob? Are you using the Threading library?
I'm not sure how it happens. As far as I remember it is the first report of such issue. You can edit OkHttpUtils2 source code and add a Try Catch block to hc_ResponseError. The source is inside the b4xlib (it is a zip file).