smithy-lang / smithy-kotlin

Smithy code generator for Kotlin (in development)
Apache License 2.0
64 stars 26 forks source link

Smithy is not compatible with OkHttp 5.0.0-alpha.14 #1068

Closed mattcreaser closed 2 months ago

mattcreaser commented 2 months ago

Describe the bug

Smithy has a dependency on OkHttp 5.0.0-alpha.11. OkHttp has made breaking changes in their newer Alpha versions, which is causing crashes for downstream consumers of Smithy.

Expected Behavior

Application using Smithy should be able to run with latest OkHttp version.

Current Behavior

java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/JvmCallExtensionsKt;
                                                                                                        at aws.smithy.kotlin.runtime.http.engine.okhttp.OkHttpEngine.roundTrip(OkHttpEngine.kt:51)
                                                                                                        at aws.smithy.kotlin.runtime.http.engine.internal.ManagedHttpClientEngine.roundTrip(Unknown Source:2)
                                                                                                        at aws.smithy.kotlin.runtime.http.SdkHttpClient$executeWithCallContext$2.invokeSuspend(SdkHttpClient.kt:44)
                                                                                                        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
                                                                                                        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)
                                                                                                        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
                                                                                                        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
                                                                                                        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)
                                                                                                        Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@ab2cfdd, Dispatchers.Default]
                                                                                                    Caused by: java.lang.ClassNotFoundException: Didn't find class "okhttp3.JvmCallExtensionsKt" on path: DexPathList[[zip file "/data/app/~~IAL8PvUtBlvnpkVvFmHIww==/com.smith.production.development-6WBupxve8b7XQGyKB-wpWw==/base.apk"],nativeLibraryDirectories=[/data/app/~~IAL8PvUtBlvnpkVvFmHIww==/com.smith.production.development-6WBupxve8b7XQGyKB-wpWw==/lib/arm64, /data/app/~~IAL8PvUtBlvnpkVvFmHIww==/com.smith.production.development-6WBupxve8b7XQGyKB-wpWw==/base.apk!/lib/arm64-v8a, /system/lib64, /system/system_ext/lib64]]
                                                                                                        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
                                                                                                        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
                                                                                                        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
                                                                                                        ... 9 more

Steps to Reproduce

  1. Upgrade OkHttp in customer application to 5.0.0-alpha.14.
  2. Build and run the app.

Possible Solution

Update OkHttp dependency to 5.0.0-alpha.14 and release a new version.

Context

Your Environment

lauzadis commented 2 months ago

We've released v1.2.0 which now depends on OkHttp v5.0.0-alpha.14. Please upgrade your dependencies to fix the issue.