Skip to content

Bug Report: Incompatibility with OkHttp 5.x – NoClassDefFoundError: okhttp3.internal.UtilΒ #78

Open

Description

@midou221

πŸ‘Ÿ Reproduction steps

  1. Add implementation("com.squareup.okhttp3:okhttp:5.1.0") to dependencies
  2. Use Appwrite SDK in your Android app
  3. Run a request that uses cookies
  4. Crash occurs at ListenableCookieJar

πŸ‘ Expected behavior

  • The Appwrite SDK should not rely on internal or private OkHttp classes.
  • ListenableCookieJar should use only public APIs (e.g. java.net.HttpCookie.parse(...)) to handle cookies.
  • App should work normally without crashing when using OkHttp 5.x.

πŸ‘Ž Actual Behavior

  • App crashes at runtime with the following error:
  • Caused by internal API usage that was removed in OkHttp 5.1.0.
  • Makes it impossible to use Appwrite SDK with the latest OkHttp versions.

🎲 Appwrite version

Appwrite Cloud

πŸ’» Operating system

Something else

🧱 Your Environment

  • Appwrite SDK version: 8.1.0
  • OkHttp version: 5.1.0
  • Android version: Any
  • Crash location: ListenableCookieJar.kt

πŸ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏒 Have you read the Code of Conduct?

Activity

  1. changed the title [-]πŸ› Bug Report: Incompatibility with OkHttp 5.x – NoClassDefFoundError: okhttp3.internal.Util[/-] [+]Bug Report: Incompatibility with OkHttp 5.x – NoClassDefFoundError: okhttp3.internal.Util[/+] on Jul 12, 2025
  2. ChiragAgg5k commented on Jul 14, 2025

    @ChiragAgg5k
    Member

    @midou221 hi there, thanks for raising this issue. can you please share the full stack trace of the error so we can pinpoint which internally removed API is being used by the appwrite sdk?

  3. ChiragAgg5k commented on Jul 14, 2025

    @ChiragAgg5k
    Member

    i am not able to find anything particular in the changelog

    Image

    https://square.github.io/okhttp/changelogs/changelog/

  4. self-assigned this
    on Jul 14, 2025
  5. midou221 commented on Jul 14, 2025

    @midou221
    Author

    @midou221 hi there, thanks for raising this issue. can you please share the full stack trace of the error so we can pinpoint which internally removed API is being used by the appwrite sdk?

    Here’s the full stack trace

    Caused by: java.lang.ClassNotFoundException: Didn't find class "okhttp3.internal.Util" on path: DexPathList[[zip file "/data/app/org.example-Ro1f0UMkG_IWRQNxsaF_cA==/base.apk"],nativeLibraryDirectories=[/data/app/org.example-Ro1f0UMkG_IWRQNxsaF_cA==/lib/arm64, /data/app/org.example-Ro1f0UMkG_IWRQNxsaF_cA==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at io.appwrite.cookies.ListenableCookieJar.decodeHeaderAsJavaNetCookies(ListenableCookieJar.kt:88)Β  at io.appwrite.cookies.ListenableCookieJar.loadForRequest(ListenableCookieJar.kt:66)Β  at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:75)Β  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:126)Β  at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:74)Β  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:126)Β  at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:208)Β  at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:530)Β  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)Β  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)Β  at java.lang.Thread.run(Thread.java:784)Β 

    The crash is triggered because the Appwrite SDK still references okhttp3.internal.Util, which was removed in OkHttpβ€―5.x.

  6. pedronveloso commented on Feb 18, 2026

    @pedronveloso

    The fix here is simple, AppWrite should be using OkHttp 5.X . Being stuck in 4.X makes no sense. Please fix

  7. ItzNotABug commented on Mar 29, 2026

    @ItzNotABug

    This is indeed legit. a quick dep bump to 5.x should ideally fix the issue πŸ‘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingquestionFurther information is requested

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions