https://kotlinlang.org logo
#getting-started
Title
# getting-started
m

MarkRS

10/01/2021, 2:48 PM
In Android Studio I have red all over my code, "import io.ktor.<anything> has "ktor" in red, "serialization" in "import kotlinx.serialization.SerialName" is also red, but the (Android) app builds. Errr, whut? It's only just started happening (although it's not unknown previously here), so I suppose I've changed something, but what could it be?
p

Paul Griffith

10/01/2021, 3:15 PM
Try File -> Invalidate Caches & Restart, sounds like the IDE is out of sync with 'reality' or at least Gradle
m

MarkRS

10/01/2021, 3:17 PM
I agree, and I'm beginning to doubt my sanity, and reality. I've not only tried that (invalidate & restart, a few times), I've rebuilt the project, I've removed .idea/workspace.xml, I've even tried whistling dixie, doesn't seem to help :(
j

Jiddles

10/01/2021, 3:30 PM
You could try deleting your build folders too, some aren’t deleted when you invalidate. Failing that, if you code is version contrlled, you create a new copy of the project and open it fresh (a git clone into a different folder or the equivalent for any other VCS system)
c

CLOVIS

10/01/2021, 3:48 PM
@Jiddles if the app compiles & runs, the problem can't be in the
build/
folder (which is entirely managed by Gradle)
j

Joffrey

10/01/2021, 3:53 PM
There was a bug recently with a recent Kotlin plugin and recent IDEs, but I don't know which exact combination. If nothing else works you might want to try reverting to the bundled version of the Kotlin plugin
m

MarkRS

10/01/2021, 4:14 PM
"Bundled version" @Joffrey?
j

Joffrey

10/01/2021, 4:48 PM
I mean the version of the Kotlin plugin that is bundled with the IDE (without extra installation). Not sure for Android Studio but it is likely bundled as well. To revert to the bundled version, in IDEA you can uninstall the Kotlin plugin from the Settings > Plugins. It might be similar in AS.
👍 1
12 Views