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

Support aws-sdk-kotlin / smithy-kotlin's OkHttp4Engine #17

Open
lauzadis opened this issue Nov 20, 2024 · 3 comments
Open

Support aws-sdk-kotlin / smithy-kotlin's OkHttp4Engine #17

lauzadis opened this issue Nov 20, 2024 · 3 comments
Assignees

Comments

@lauzadis
Copy link

Hello, I am from the AWS SDK for Kotlin team. We have a customer trying to use this project and running into issues with their OkHttp configuration.

We offer an OkHttp4 engine for users that can't rely on the default engine which uses OkHttp5, an alpha version. The customer configured their project to use this OkHttp4Engine, but your project creates its own Kotlin SDK clients which still use OkHttp5, causing conflicts for the customer.

Are you able to provide some configuration options for users who want to use the OkHttp4Engine? One way this could be done is by accepting a custom Kotlin SDK as an optional parameter wherever it's used. Another option is to configure your own Kotlin SDK clients to use the OkHttp4Engine, since I noticed this project uses OkHttp 4.12.0.

@lauzadis lauzadis changed the title Support aws-sdk-kotlin / smithy-kotlin's OkHttp4Engine Support aws-sdk-kotlin / smithy-kotlin's OkHttp4Engine Nov 20, 2024
@cgalvan cgalvan self-assigned this Nov 20, 2024
@cgalvan
Copy link
Contributor

cgalvan commented Nov 20, 2024

Hello @lauzadis ,

Thanks for reaching out! We actually made a change recently that modifies the API to to return the client configuration instead of a client, which should allow your customer to create their own client and then just use our authentication SDK to provide the proper cognito configuration for the client.

I can reply directly on that linked issue, and I'll keep this issue open until that one is resolved.

@drayan85
Copy link

drayan85 commented Nov 21, 2024

@cgalvan ,
I have tried as you suggested above and still I am getting error. You can find the sample repository in the following URL (https://github.com/drayan85/AWS-Location-Demo).
Please change the values for AWS_COGNITO_POOL_ID & AWS_PLACE_INDEX

If you want to reproduce by yourself.

Process: com.aws.demo, PID: 18654
java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/coroutines/ExecuteAsyncKt;
	at aws.smithy.kotlin.runtime.http.engine.okhttp.OkHttpEngine.roundTrip(OkHttpEngine.kt:56)
	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:101)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:832)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@d5b34a2, Dispatchers.Main.immediate]
Caused by: java.lang.ClassNotFoundException: Didn't find class "okhttp3.coroutines.ExecuteAsyncKt" on path: DexPathList[[dex file "/data/data/com.aws.demo/code_cache/.overlay/base.apk/classes3.dex", dex file "/data/data/com.aws.demo/code_cache/.overlay/base.apk/classes5.dex", zip file "/data/app/~~lOQBgcnKMDcsrlS4c8qxBg==/com.aws.demo-Rr7zKExyvJ5wJD0SAGj7Ug==/base.apk"],nativeLibraryDirectories=[/data/app/~~lOQBgcnKMDcsrlS4c8qxBg==/com.aws.demo-Rr7zKExyvJ5wJD0SAGj7Ug==/lib/arm64, /system/lib64, /system_ext/lib64]]
	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:637)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:573)

@drayan85
Copy link

@cgalvan ,
Any updates on this issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants