3

I want to use jetbrains exposed library in a kotlin multiplatform library I am writing. How do I do this? I am getting a gradle build error that it can not find everything it needs for exposed. Here is my gradle build

sourceSets {
    val commonMain by getting {
        dependencies {
            implementation("org.jetbrains.exposed:exposed-core:0.34.1")
        }
    }
    val commonTest by getting {
        dependencies {
            implementation(kotlin("test"))
        }
    }
    val jvmMain by getting
    val jvmTest by getting
    val jsMain by getting
    val jsTest by getting
    val nativeMain by getting
    val nativeTest by getting
}

and I get this in the build log

Failed building KotlinMPPGradleModel
org.gradle.internal.resolve.ArtifactNotFoundException: Could not find exposed-core-0.34.1-samplessources.jar (org.jetbrains.exposed:exposed-core:0.34.1).
Searched in the following locations:
    https://repo.maven.apache.org/maven2/org/jetbrains/exposed/exposed-core/0.34.1/exposed-core-0.34.1-samplessources.jar
    at org.gradle.internal.resolve.result.DefaultBuildableArtifactResolveResult.notFound(DefaultBuildableArtifactResolveResult.java:28)...
Kyle M
  • 119
  • 7
  • This library [doesn't support](https://github.com/JetBrains/Exposed/issues/635) kotlin multiplatform. Available options are SQLDelight and Realm(it's in alpha) – Phil Dukhov Oct 31 '21 at 19:40

1 Answers1

2

This library targets jvm only, since you have native targets it isn't compatible with your common source set

Róbert Nagy
  • 6,720
  • 26
  • 45