Use of library from commonMain in Kotlin Multiplatform Project
See original GitHub issueDescribe the issue
I can include following for example as commonMain
dependency in shared module of a Kotlin Multiplatform project and access/use code from JVM and Android code but if I try to use from commonMain
source then only certain symbols appear to be resolvable (for example can access StaticCredentialsProvider
but not DynamoDbClient
). Perhaps this is expected right now?
api("aws.sdk.kotlin:dynamodb:0.9.4-beta")
Steps to Reproduce
per description
Current behavior
per description
AWS Kotlin SDK version used
0.9.4
Platform (JVM/JS/Native)
JVM/Android/Common
Operating System and version
macOS 11.4
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Is it possible to use common kotlin library (not multiplatform ...
Currently it is not possible to publish a common-only library. You have to declare targets from the beginning.
Read more >CommonMain sourceSet not indexing dependencies properly
Create a multiplatform project using the intellij wizard, gradle -> kotlin/multiplatform, with any artifact coordinate. Add a js and jvm target with normal ......
Read more >Simple way to use common resources in Kotlin multi-platform ...
Simple way to use common resources in Kotlin multi-platform project · android() jvm("desktop") sourceSets · named("commonMain") · resources.srcDirs ...
Read more >no build output compiled for common module of Kotlin ...
Do I understand right that you have a multiplatform library and some of multiplatform apps that depends on the lib? And app:commonMain can't...
Read more >Introduction to Multiplatform Programming in Kotlin
This kotlin-multiplatform plugin configures the project for creating an application or library to work on multiple platforms.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s correct @joreilly, this is a known issue. We’re in the final stages of changes which will remove the CRT as a required dependency and enable the AWS SDK for Kotlin to run on Apple M1 so hopefully that issue won’t be around much longer.
The fix for this issue has been pushed to main and should be included in the next release (likely this week). With that release, it should be possible to reference service clients and related types from common source sets (instead of requiring JVM).
Note that the AWS SDK for Kotlin does yet not support non-JVM targets but they are on our roadmap as #228 and #229.