Java Question How to reference correcty if a lib internal is using okhttp?


Licensed User
The Library i am currectly wrapping is referencing okhttp inside the Library.
import com.squareup.okhttp.Callback;
import com.squareup.okhttp.HttpUrl;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import com.squareup.okhttp.Response;
import com.squareup.okhttp.ResponseBody;
import com.squareup.okhttp.logging.HttpLoggingInterceptor;
I found out that i need to use a 2.7.5 release of okhttp to get this imports working.

How can i reference them using the okhttp jars provided with B4A (the V3.x) from within the Library? Any hints are welcome ;-)


Staff member
Licensed User
The problem is that OkHttp v3 is not backward compatible. You will not be able to use both versions at the same time (without modifying OkHttp v2 source code and changing all the package names).


Licensed User
I already fear like this.
Not using okhttputils in the App it works using references to the 2.x version.

I´ll create a Ticket on their supportplatform to ask to update the refs to v3+
Last edited: