First of all,
I\'m pretty much aware that a lot of questions on this error had been posted already here, and none of them seems to be having a proper solution especia
After a week's struggle, I finally found the issue.
I added the kotlin-kapt plugin for realm.
And I had a folder named interface itself to hold some interfaces.
I implemented one of the interfaces from the interface folder in MainActivity.
Now the import for the interface was something like this,
import com.android.app.java.interface.Listener
Where, the keyword interface confused the annotation processor, hence caused error while generating stub.
I renamed the folder (from interface to intrface).
That solved the error.
This is a very simple mistake that cost me a week.
Anyway, found the issue. Yay!