I opened my Studio today and Android Studio didn't recognize Kotlin files. .kt files started showing up as just an ordinary file. I checked my Plugins and I still have the Kotlin plugin. I tried uninstalling and installing it again. But no use.
I tried building my building my project from Terminal and it works fine. But Android studio doesn't understand Kotlin files.
Configuration:
Android Studio 3.1
Kotlin 1.2.41
OS: MacOS Sierra
Go to Library/Preferences and delete the AndroidStudio3.1 folder. This is the config directory for my Android Studio.
Once deleted, I started Studio again, and the config was created fresh. Now everything worked perfectly.
Lets say, I'm creating new file named HomeFragment, and AndroidStudio didn't recognize it as kotlin file. Fix Steps:
File type auto-detected by file content, make sure this sections doesn't have prefill File name patterns - HomeFragment, if it does, delete it.Kotlin, make sure it has "*.kt"Text, make sure it doesnt have "*.kt"once done, click Apply and OK

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With