Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How to use properly in multi-platform project? #5

@Zomis

Description

@Zomis

I have a multiplatform project where I have common, desktop, js, android, etc. On the platforms it works fine, but when I use a logger in my common code, the IDE shows it as a compiler error, but when running it it still runs fine.

To try to solve the IDE showing a compiler error, I tried adding a dependency on klog-metadata as below:

        val commonMain by getting {
            kotlin.srcDir("common/src/main/kotlin")
            dependencies {
                implementation(kotlin("stdlib-common"))
                implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
                implementation("com.github.lewik.klog:klog-metadata:2.0.5") // This line was added
            }
        }

But then Gradle doesn't even build it and says:

Could not find com.github.lewik.klog:klog-metadata:2.0.5.
Searched in the following locations:
  - https://dl.google.com/dl/android/maven2/com/github/lewik/klog/klog-metadata/2.0.5/klog-metadata-2.0.5.pom
  - https://repo.maven.apache.org/maven2/com/github/lewik/klog/klog-metadata/2.0.5/klog-metadata-2.0.5.pom
  - https://maven.pkg.jetbrains.space/public/p/compose/dev/com/github/lewik/klog/klog-metadata/2.0.5/klog-metadata-2.0.5.pom
  - https://jitpack.io/com/github/lewik/klog/klog-metadata/2.0.5/klog-metadata-2.0.5.pom

How to properly use klog from the common part of a multi-platform project?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions