Android Studio kotlin file name is not recognized

Viewed 33

The file structure and class name

So I have this file structure (checkout the link), as you can see, the Doctor is recognized normally, there is only one open class in the Doctor.kt class which is the Doctor class, and the HospitalDoctor.kt file also only contains HospitalDoctor class that extends Doctor, but it is recognized as a plain text file by the android studio, if I change it to any other name such as "my class", "newclass", and even "HospitalDocto" (miss a r at the end) it will be recognized as a class file as it should be. As AS think this file is txt, it shows error when I create a HospitalDoctor instance(unresolved reference), but it can actually run normally without any error. And the same project if I open with any other IDE like Intellij, it doesn't have this weird issue. What's going on with my Android Studio and how to fix this?

0 Answers
Related