Skip to content

Amplify and Okhttp #2632

@victorkifer

Description

@victorkifer

Hello!

There's a similar closed issue.

We're in the process to implement authentication with Cognito using Amplify Auth. At the moment however we are blocked with this sdk due to the usage of okhttp:5-alpha in it. Attached is the crash that we're getting in the runtime which is related to incompatibilities in okhttp versions.

The crash java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/Util;
at okhttp3.internal.sse.RealEventSource.processResponse(RealEventSource.kt:69)
at okhttp3.internal.sse.RealEventSource.onResponse(RealEventSource.kt:46)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:539)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.ClassNotFoundException: Didn't find class "okhttp3.internal.Util" on path: DexPathList[[zip file "/data/app/~~kHWq-VwP7-e5MpvJAmE_uw==/com.zegocover.zego.qa-1U5rJX4k6xbdkKhpFtLl-g==/base.apk"],nativeLibraryDirectories=[/data/app/~~kHWq-VwP7-e5MpvJAmE_uw==/com.zegocover.zego.qa-1U5rJX4k6xbdkKhpFtLl-g==/lib/arm64, /data/app/~~kHWq-VwP7-e5MpvJAmE_uw==/com.zegocover.zego.qa-1U5rJX4k6xbdkKhpFtLl-g==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at okhttp3.internal.sse.RealEventSource.processResponse(RealEventSource.kt:69) 
at okhttp3.internal.sse.RealEventSource.onResponse(RealEventSource.kt:46) 
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:539) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) 
at java.lang.Thread.run(Thread.java:1012) 

We cannot use okhttp 5 cause other third-party sdks are built on top of okhttp 4.

So I wanted to ask if you know of any workarounds for this issue? Is there another SDK from amazon that doens't require okhttp 5?

Metadata

Metadata

Assignees

No one assigned

    Labels

    closing soonThis issue will be closed in 7 days unless further comments are made.pending-maintainer-responseIssue is pending response from an Amplify team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions