There is a red squiggly that has appeared in the G...
# intellij
n
There is a red squiggly that has appeared in the Gradle pane after doing a Gradle refresh (added a new dependency to the build file). IntelliJ isn't providing a message that explains why the red squiggly has appeared. Below is part of the build file where the dependency has been added:
Copy code
linuxArm32Hfp("linuxArm32") {
        compilations.getByName("main") {
            // ...
            dependencies {
                implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:" +
                    kotlinxSerializationVer)
            }
        }
// ...
}
Under External Libraries there is a entry for org.jetbrains.kotlinx:kotlinx-serialization-runtime-linuxarm32hfp but not for org.jetbrains.kotlinx:kotlinx-serialization-runtime-native.
Compiled the Kotlin Native program (via a link task) and the program compiles successfully. Ran the program on a Rpi 2 which works fine. That leaves IntelliJ which is showing a error that doesn't exist (aka false positive).
Used the following test code:
Copy code
import kotlinx.serialization.Serializable
import kotlinx.serialization.ImplicitReflectionSerializer
import kotlinx.serialization.json.Json.Default.stringify
import kotlinx.serialization.serializer

@Serializable
data class BatteryTelemetry(val voltage: Int, val current: Int)

@ImplicitReflectionSerializer
private fun printJson() {
    val data = BatteryTelemetry(voltage = 60, current = 20)
    println("JSON String:\n${stringify(BatteryTelemetry::class.serializer(), data)}")
}

@ImplicitReflectionSerializer
fun main(args: Array<String>) {
    // ...
    printJson()
    // ...
}
a
This looks like a bug, can you please create a bug report at http://kotl.in/issue with a sample project attached if possible? Thanks!
n
A new issue has been created in the Issue Tracker: https://youtrack.jetbrains.com/issue/KT-38977
🙏 1
Unfortunately the project I am working on is a commercial project. The best I can do is supply instructions on recreating the issue in IntelliJ.