question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

aws-sdk-kotlin does not work on apple silicon

See original GitHub issue

Describe the bug

Currently using the aws-sdk-kotlin on Apple Silicon does not work

Unable to unpack AWS CRT lib: java.io.IOException: Unable to open library in jar for AWS CRT: /osx/armv8/libaws-crt-jni.dylib
java.io.IOException: Unable to open library in jar for AWS CRT: /osx/armv8/libaws-crt-jni.dylib
	at software.amazon.awssdk.crt.CRT.extractAndLoadLibrary(CRT.java:158)
	at software.amazon.awssdk.crt.CRT.loadLibraryFromJar(CRT.java:223)
	at software.amazon.awssdk.crt.CRT.<clinit>(CRT.java:33)
	at software.amazon.awssdk.crt.CrtResource.<clinit>(CrtResource.java:100)
	at aws.sdk.kotlin.crt.io.EventLoopGroup.<init>(EventLoopGroupJVM.kt:22)
	at aws.sdk.kotlin.runtime.crt.SdkDefaultIO$EventLoop$2.invoke(SdkDefaultIO.kt:24)
	at aws.sdk.kotlin.runtime.crt.SdkDefaultIO$EventLoop$2.invoke(SdkDefaultIO.kt:22)
	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
	at aws.sdk.kotlin.runtime.crt.SdkDefaultIO.getEventLoop(SdkDefaultIO.kt:22)
	at aws.sdk.kotlin.runtime.crt.SdkDefaultIO$ClientBootstrap$2.invoke(SdkDefaultIO.kt:38)
	at aws.sdk.kotlin.runtime.crt.SdkDefaultIO$ClientBootstrap$2.invoke(SdkDefaultIO.kt:37)
	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
	at aws.sdk.kotlin.runtime.crt.SdkDefaultIO.getClientBootstrap(SdkDefaultIO.kt:37)
	at aws.sdk.kotlin.runtime.http.engine.crt.CrtHttpEngine.<init>(CrtHttpEngine.kt:60)
	at aws.sdk.kotlin.runtime.http.engine.crt.CrtHttpEngine.<init>(CrtHttpEngine.kt:32)
	at aws.sdk.kotlin.services.dynamodb.DefaultDynamoDbClient.<init>(DefaultDynamoDbClient.kt:36)
	at aws.sdk.kotlin.services.dynamodb.DynamoDbClient$Companion.invoke(DynamoDbClient.kt:64)
	at aws.sdk.kotlin.services.dynamodb.DynamoDbClient$Companion.invoke$default(DynamoDbClient.kt:58)

Expected behavior

To not fail

Current behavior

Raises

Caused by: software.amazon.awssdk.crt.CrtRuntimeException: software.amazon.awssdk.crt.CrtRuntimeException: Unable to unpack AWS CRT library UNKNOWN(-1) UNKNOWN(-1)
	at software.amazon.awssdk.crt.CRT.loadLibraryFromJar(CRT.java:233)
	at software.amazon.awssdk.crt.CRT.<clinit>(CRT.java:33)
	... 23 more

Steps to Reproduce

Run the following code:

import aws.sdk.kotlin.services.dynamodb.DynamoDbClient

suspend fun main() {
    val client = DynamoDbClient { region = "us-west-2" }
    client.listTables { limit = 10 }
}

Possible Solution

Fix related issue : https://github.com/awslabs/aws-crt-java/issues/371

Context

No response

AWS Kotlin SDK version used

0.9.5-beta

Platform (JVM/JS/Native)

openjdk 17.0.1 2021-10-19 LTS

Operating System and version

Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:01 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T6000 arm64

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
etolstoycommented, Mar 5, 2022

Tried with 0.13.1-beta, still doesn’t work with Apple Silicon with the same error as above. Any plans to fix it in the upcoming versions?

1reaction
vcanuelcommented, May 29, 2022

Indeed M1 is now supported in aws-crt-java-0.16.10. Hope we could bump to this version soon 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set up the AWS SDK for Kotlin
Learn the details about how to set up your development environment to work with AWS SDK for Kotlin.
Read more >
Can't build to simulator on Apple Silicon
1) I've tried "pod install" & "pod update" with a Rosetta2 version of Terminal. Both complete without error, but Xcode still can't build....
Read more >
PyCharm 2020.3.2 Supports Apple Silicon - The JetBrains Blog
We have special news for those of you using Mac with an M1 chip: PyCharm 2020.3.2 is out and brings support for Apple...
Read more >
AWS Finally Gets Official SDKs for Rust, Kotlin, and Swift - InfoQ
Previewed at Re:invent, the new AWS SDKs for Rust, Kotlin, and Swift provide idiomatic wrappers around AWS APIs that will allow developers ...
Read more >
Apple M1 Processor Overview and Compatibility - Toptal
Sticking to 8GB or 16GB of RAM on the MacBook Air or Mac Mini shouldn't be a problem for most users, but many...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found