Closed agustinsivoplas closed 7 years ago
I wonder if this has to do with https://github.com/square/okhttp/issues/2961 as well.
I fixed it by setting the log level to headers.
logging.setLevel(HttpLoggingInterceptor.Level.HEADER);
Are you calling createService
every time you need to make a request? Because you're adding the same interceptor over and over and over.
Please provide an executable test case.
@JakeWharton You are right, I was adding the same interceptor over and over. Sorry
Thanks a lot to @agustinsivoplas for the very rarely foudn solution to the one of most trivial problems on OkHttp and retrofit. Equally thanks to @tachang. I was struggling with a solution and in want of a solution very badly I found this article and to my surprise it worked.
As I found out if you remove
HttpLoggingInterceptor logging = new HttpLoggingInterceptor(); logging.setLevel(HttpLoggingInterceptor.Level.BODY); httpClient.addInterceptor(logging);
OR as @tachang said to make the log level to: logging.setLevel(HttpLoggingInterceptor.Level.HEADER);
Thanks again to all...
@dibyendumr Glad to help. Thank you for the great library.
I have this class to create a service with retrofit2 + rxandroid + okhttp.
This code causes an stackoverflow error in android kitkat.
But if I remove this line of code, works perfect.
I have uses this class without RxAndroid and works perfect with this versions:
Nowadays I'm using:
Also I have created a stackoverflow question: http://stackoverflow.com/questions/40441957/retrofit-rxandroid-causes-stackoverflow-error-on-kitkat
Thanks