android-studiokotlin-multiplatform

Syntax highlighting fails in Kotlin Multiplatform project


I have generated a new Kotlin Multiplatform Mobile (KMM) project with Android Studio. I am able to do the following things successfully:

The issue is that syntax highlighting is not working. I see IDE hints, as seen in the image below, but still, there are red marks under everything.

enter image description here

I have tried the following

but none of these have worked.

I have the following versions:

This is all boilerplate code generated by the KMM plugin for Android Studio, so I'll hold off with posting any code unless anyone wants me to.

What could be the issue?


Solution

  • Update: Use the suggestion below as a last resort. Instead, try following the built-in troubleshooting guide in Android Studio.


    I solved the issue by going to File > Manage IDE Settings and clicking Restore Default Settings. Then it restarted, took me through the Android Studio setup wizard, and when launching the project syntax highlighting worked as expected.