okhttp-digest: java.lang.NoSuchFieldError

It worked fine for a long time until I switched to io.github.rburgst:okhttp-digest:2.5 from jcenter recently.

The Android app crashes with the following error despite the code is in a try-catch block.

java.lang.NoSuchFieldError: 
  at com.burgstaller.okhttp.digest.DigestAuthenticator.authenticateWithState (DigestAuthenticator.java:242)
  at com.burgstaller.okhttp.digest.DigestAuthenticator.authenticate (DigestAuthenticator.java:180)
  at com.burgstaller.okhttp.DispatchingAuthenticator.authenticate (DispatchingAuthenticator.java:45)
  at com.burgstaller.okhttp.CachingAuthenticatorDecorator.authenticate (CachingAuthenticatorDecorator.java:35)
  at okhttp3.internal.http.RetryAndFollowUpInterceptor.followUpRequest (RetryAndFollowUpInterceptor.java:292)
  at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept (RetryAndFollowUpInterceptor.java:160)
  at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:147)
  at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:121)
  at com.burgstaller.okhttp.AuthenticationCacheInterceptor.intercept (AuthenticationCacheInterceptor.java:49)
  at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:147)
  at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:121)
  at okhttp3.RealCall.getResponseWithInterceptorChain (RealCall.java:254)
  at okhttp3.RealCall.execute (RealCall.java:92)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (8 by maintainers)

Most upvoted comments

we’ve got exactly the same problem:

java.io.IOException: canceled due to java.lang.NoSuchFieldError: INSTANCE
        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:185) ~[okhttp-3.14.9.jar:na]
        at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) ~[okhttp-3.14.9.jar:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:na]
        at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]
        Suppressed: java.lang.NoSuchFieldError: INSTANCE
                at com.burgstaller.okhttp.digest.DigestAuthenticator.authenticateWithState(DigestAuthenticator.java:242) ~[okhttp-digest-2.5.jar:na]
                at com.burgstaller.okhttp.digest.DigestAuthenticator.authenticate(DigestAuthenticator.java:180) ~[okhttp-digest-2.5.jar:na]
                at com.burgstaller.okhttp.DispatchingAuthenticator.authenticate(DispatchingAuthenticator.java:45) ~[okhttp-digest-2.5.jar:na]
                at com.burgstaller.okhttp.CachingAuthenticatorDecorator.authenticate(CachingAuthenticatorDecorator.java:35) ~[okhttp-digest-2.5.jar:na]
                at okhttp3.internal.http.RetryAndFollowUpInterceptor.followUpRequest(RetryAndFollowUpInterceptor.java:230) ~[okhttp-3.14.9.jar:na]
                at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:119) ~[okhttp-3.14.9.jar:na]
                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.9.jar:na]
                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.9.jar:na]
                at com.burgstaller.okhttp.AuthenticationCacheInterceptor.intercept(AuthenticationCacheInterceptor.java:49) ~[okhttp-digest-2.5.jar:na]
                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.9.jar:na]
                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.9.jar:na]
                at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229) ~[okhttp-3.14.9.jar:na]
                at okhttp3.RealCall$AsyncCall.execute(RealCall.java:172) ~[okhttp-3.14.9.jar:na]
                ... 4 common frames omitted

do you have any tip what can be the problem?

one important note that this code in a container within a spring boot service…