Retrofit: java.lang.NoSuchMethodError: okhttp3.HttpUrl.get(Ljava/lang/String;)Lokhttp3/HttpUrl;

Created on 28 Mar 2019  路  2Comments  路  Source: square/retrofit

when I set baseUrl锛孖 got a problem :
java.lang.NoSuchMethodError: okhttp3.HttpUrl.get(Ljava/lang/String;)Lokhttp3/HttpUrl;

This problem only happened when I used version 2.5 , if I uesd 2.4 ,it is OK.

I have solved this problem , the okhttp version mismatch the retrofit version, when I used both the newest version , this problem is solved

Most helpful comment

Use OkHttp 3.12.2 or newer.

All 2 comments

Use OkHttp 3.12.2 or newer.

And the pom declares a dependency on that version so if it wasn't present you like have a misconfiguration on the side of your build system which we can't control.

Was this page helpful?
0 / 5 - 0 ratings