Kotlin Custom View class implements an interface that cannot be resolved in `:app:compileDebugKotlinAfterJava`. Identical Java version works fine

There was a problem with the IDE caching and indexing, and deleting the build folder didn’t help. Click on Invalidate Caches and Restart in Android Studio’s menu.

This should solve the issue.