Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core-kotlin is not compatible with the latest OkHttp version #2778

Closed
1 task done
dawidhyzy opened this issue Apr 18, 2024 · 6 comments
Closed
1 task done

core-kotlin is not compatible with the latest OkHttp version #2778

dawidhyzy opened this issue Apr 18, 2024 · 6 comments
Assignees
Labels
bug Something isn't working core Amplify Core library

Comments

@dawidhyzy
Copy link

Before opening, please confirm:

Language and Async Model

Kotlin - Coroutines

Amplify Categories

Authentication

Gradle script dependencies

// Put output below this line
implementation(libs.amplifyframework.core) // com.amplifyframework:core-kotlin:2.15.1
implementation(libs.amplifyframework.aws.auth.cognito) // com.amplifyframework:aws-auth-cognito:2.15.1
implementation(libs.okhttp) // com.squareup.okhttp3:okhttp:5.0.0-alpha.14

Environment information

# Put output below this line
------------------------------------------------------------
Gradle 8.7
------------------------------------------------------------

Build time:   2024-03-22 15:52:46 UTC
Revision:     650af14d7653aa949fce5e886e685efc9cf97c10

Kotlin:       1.9.22
Groovy:       3.0.17
Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM:          17.0.9 (JetBrains s.r.o. 17.0.9+7-b1087.7)
OS:           Mac OS X 14.4.1 aarch64

Please include any relevant guides or documentation you're referencing

No response

Describe the bug

After upgrading OkHttp to 5.0.0-alpha.14 app crash with

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

Reproduction steps (if applicable)

No response

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


amplifyconfiguration.json

No response

GraphQL Schema

// Put your schema below this line

Additional information and screenshots

No response

@github-actions github-actions bot added the pending-triage Issue is pending triage label Apr 18, 2024
@mattcreaser mattcreaser added bug Something isn't working core Amplify Core library labels Apr 18, 2024
@github-actions github-actions bot removed the pending-triage Issue is pending triage label Apr 18, 2024
@mattcreaser
Copy link
Member

We need Smithy and Kotlin SDK to release new versions that are compatible with the OkHttp changes. There's not much we can do until those become available.

@mattcreaser
Copy link
Member

I've posted a bug to the Smith library here: smithy-lang/smithy-kotlin#1068

@mattcreaser mattcreaser self-assigned this Apr 19, 2024
@dawidhyzy
Copy link
Author

dawidhyzy commented Apr 26, 2024

Thanks @mattcreaser
Looks like the update was just released https://github.com/smithy-lang/smithy-kotlin/releases/tag/v1.2.0
https://github.com/smithy-lang/smithy-kotlin/blob/v1.2.0/gradle/libs.versions.toml#L10

@mattcreaser
Copy link
Member

mattcreaser commented Apr 26, 2024

We will test this change through the first part of next week, if all goes well we'll get it into an upcoming release.

@mattcreaser mattcreaser added the pending-release Code has been merged but pending release label Jun 3, 2024
@tylerjroach
Copy link
Member

The change has been made in Amplify Android 2.18.0

@github-actions github-actions bot removed the pending-release Code has been merged but pending release label Jun 4, 2024
Copy link
Contributor

github-actions bot commented Jun 4, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core Amplify Core library
Projects
None yet
Development

No branches or pull requests

3 participants