Hi ! I'm having unresolved imports in Fleet, in my...
# fleet
l
Hi ! I'm having unresolved imports in Fleet, in my KMM project, dealing with Kotlinx serialisation, more in 🧵
I'm trying to load these imports
Copy code
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.Json
import kotlinx.serialization.decodeFromString
in my Kotlin source file
In my libs.versions.toml, I've added this line
Copy code
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
inside the plugins sections, and reloaded gradle.
This is my build.gradle.kts plugin section
Copy code
plugins {
    alias(libs.plugins.kotlinMultiplatform)
    alias(libs.plugins.androidApplication)
    alias(libs.plugins.jetbrainsCompose)
    alias(libs.plugins.compose.compiler)
    alias(libs.plugins.kotlin.serialization)
}
m
Did you add the necessary dependencies in Gradle? org.jetbrains.kotlinx:kotlinx-serialization-json
l
Oh sorry, I forgot to say that I also added the yaml version of the dependency
Copy code
kotlinx-serialization-yaml = {group = "org.jetbrains.kotlinx", name="kotlinx-serialization-yaml", version.ref="kotlinx-serialization-yaml"}
in my libs.versions.toml, library section
Copy code
implementation(libs.kotlinx.serialization.yaml)
in the desktop section of build.gradle.kts (I only need it in desktop code, using expect/actual)
Also I added the kaml library, for yaml
Copy code
kaml = {group = "com.charleskorn.kaml", name="kaml", version.ref="kaml"}
a
Hi, Laurent. Does project compile successfully by Gradle?
p
Fleet is pretty flaky atm, my steps to fix similar issues are: 1, Restart 2. Turn off smart mode and then turn back on 3. Clean the cache
l
Hi ! Indeed the Gradle compiler compiles without any error. Thank you also Per-Erik. I'll try to restart by cleaning the cache.
Where is the clean cache menu ? I'm still seaching it. 🧐
Ok I found it under the actions search bar. I followed Per-Erik steps, but it did not solve my syntax error issue on the kotlinx.serialization.* imports.
🤔 1
a
@loloof64 would it be possible to have the project to check? For uploading you can use https://uploads.jetbrains.com
l
Yes, thank you. I'm gonna share the libs.versions.toml and the two build.gradle.kts
a
Would it be possible to have the complete isolated reproducible example?
l
I can also share the link to the latest state of my Github repository.
👍 1
gratitude thank you 1
Here the latest commit of my KMP project (can run on Android/Linux/Windows). https://github.com/loloof64/DropboxExperimentComposeMP/tree/6fc1a38180c7a40c63bef094b61327a80363d590