I made a Java project in Android Studio, and tried to put a file in Kotlin. But you can see that Android Studio doesn’t recognize Kotlin files in the same project that contains Java files. Can anyone help please?
Attached photos explaining better:
I made a Java project in Android Studio, and tried to put a file in Kotlin. But you can see that Android Studio doesn’t recognize Kotlin files in the same project that contains Java files. Can anyone help please?
Attached photos explaining better:
2
Answers
I discovered to fix this error. It has to put the following code in root build.gradle file:
Thank you very to all that tried to help.
Maybe you used Annotation in that class. Add kotlin-kapt plugin in build.gradle/module ,this may fix your problem. You can read this document for more guidence.
Then sync your project.