Hello everybody, I'm trying to build a library and...
# multiplatform
i
Hello everybody, I'm trying to build a library and I always find my imports unresolved, IDK if I should do something. but everything runs fine.
Copy code
val commonMain by getting {
    dependencies {
        implementation("org.jsoup:jsoup:1.13.1")
    }
}
☝️ 1
g
Isn't jsoup a Java library? If so, it's doesn't belong into the
commonMain
dependencies. You can add it however into the jvm or android dependencies
i
@Giorgos Neokleous Thanks, But I want to take advantage of making this part common for platforms, as the library will parse the HTML. it's just not helpful during development as you lose IDE features due to unresolved references.
g
What you are having now compiles for your JVM target but it won't compile on any other target. It will just not work. 1. You need to move the dependency to the jvm dependencies. 2. Create a wrapper/facade around jsoup in Common with
actual
and
expect
. Your wrapper will make use of
actual
and you will need to provide an implementation for every
actual
which in your case the JVM
actual
will be using jsoup.