1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

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

Discussion in 'Libraries developers questions' started by DonManfred, May 17, 2019.

  1. DonManfred

    DonManfred Expert 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 ;-)
  2. Erel

    Erel Administrator 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).
    DonManfred likes this.
  3. DonManfred

    DonManfred Expert 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: May 19, 2019
    Erel likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice