After importing a fresh copy of an existing (working) project from the version control system, I get this strange error in some of my Kotlin files:
(The project is a Maven Java project, with one of the modules containing several Kotlin classes that up until now has coexisted and communicated with the Java classes and modules/packages without issue.)
Package directive does not match the file location
Change file's package to 'src.main.java.e2e.utils"
This is a bit strange, isn’t it? Looks like the pacakge isn’t recognized/registered in some way? No packages I’ve ever seen has included the “src.main.java” in their name?
One of the files with the error, and corresponding “Kotlin: Unresolved reference” because of this:
I know that screenshots are often frowned upon, but I don’t know any better way to show this. That the package name IS indeed correct, but IntelliJ claims that it isn’t, and that the reported reference DOES indeed exist, even though IntelliJ claims it doesn’t.
Please advice on how to better demonstrated this for clarity, if this isn’t good enough.