question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IntelliJ Idea: Unresolved reference: serializer

See original GitHub issue

Idea doesn’t compile project files with an error: “Kotlin: Unresolved reference: serializer”. I tried various cleanup task and IDE restarting and a project reimport but it doesn’t solve the issue.

Meantime gradle itself works perfectly without any errors.

build.gradle.kts

buildscript {
  repositories { jcenter() }

  dependencies {
    classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.0")
    classpath("org.jetbrains.kotlin:kotlin-serialization:1.3.0")
  }
}

apply {
  plugin("kotlin")
  plugin("kotlinx-serialization")
  ...
}

dependencies {
  compile(kotlin("stdlib", "1.3.0"))
  compile("org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.9.0")
  ...
}

Idea version

IntelliJ IDEA 2018.2.5 (Ultimate Edition)
Build #IU-182.4892.20, built on October 16, 2018
JRE: 1.8.0_152-release-1248-b19 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14

Idea kotlin plugin version:

1.3.0-release-IJ2018.2-1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:36 (9 by maintainers)

github_iconTop GitHub Comments

9reactions
ghostcommented, Jun 13, 2019

This problem is back:

IntelliJ IDEA 2019.1.3 (Ultimate Edition) Build #IU-191.7479.19, built on May 28, 2019 JRE: 1.8.0_202-release-1483-b58 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0

serializer() function shows unresolved…

I see this intermittently day after day, not all the time, really weird. Gradle build is all ok. Looks like it’s the IDE.

7reactions
ghostcommented, Aug 13, 2019

To me it doesn’t fix it by restarting, I also have to delete the gradle.xml from .idea dir to fix it. Really annoying because restarting means quite a lot of reload, reindex, reimport etc… This should be reopened IMO.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unresolved reference serializer() in Kotlin - YouTrack - JetBrains
IDEA marks serializer() as unresolved reference, because of receiver type mismatch, but the code compiles and works fine. Gradle file: apply plugin: 'kotlin- ......
Read more >
Kotlin Serialization: "Unresolved reference - Stack Overflow
I think the Kotlin plugin itself is activating because of id("org.jetbrains.kotlin.jvm").version("1.3.20") , not because of "kotlin" .
Read more >
JS IR compiler not compatible with kotlinx.serialization?
Unresolved reference: KSerializer etc… A comment on this bug says serialization 1.0.0-RC is compatible with the Kotlin/JS IR compiler.
Read more >
Content negotiation and serialization | Ktor
The ContentNegotiation plugin serves two primary purposes: Negotiating media types between the client and server. For this, it uses the ...
Read more >
Getting Started with Kotlinx Serialization - Eric the Coder
A couple weeks ago, I benchmarked Gson, Jackson, and Moshi against ... classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version".
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found