Importing krangl in a multiplatform project does not work
clmnin opened this issue · 1 comments
clmnin commented
Question
How to add krangl as a dependency in a multiplatform project?
Summary
I'm building a multiplatform excel parser for myself and so I'm building an android app and a desktop app.
I used krangl
in jupyter notebook
to prepare the set of steps to let me do the parsing and now I'm working on integrating these operations into the Android and Desktop app. But when I try importing the lib from a common shared module (commonMain) the IDE fails to import it
Minimal reproducible example
- Download the multiplatform todo sample app - Link
- Open the build.gradle.kts in common/compose-ui/build.gradle.kts
- Add the dependency
implementation("com.github.holgerbrandl:krangl:0.17")
- Try importing the library in TodoMainUi - common/compose-ui/src/commonMain/kotlin/example/todo/common/ui/TodoMainUi.kt
import krangl.readExcel
But it works in the desktop module
- Download the todo app
- Add the dependency in the desktop module's build.gradle.kts - desktop/build.gradle.kt
implementation("com.github.holgerbrandl:krangl:0.17")
- Import krangl in desktop Main.kt - desktop/src/jvmMain/kotlin/example/todo/desktop/Main.kt
clmnin commented
krangl
is not a multiplatform library and so if I try to import it from commonMain
it won't work. It works in platform specifc modules like desktopMain and androdMain which can be JVM dependent libraries.