I am working on a Kotlin+Java hybrid project.
The Gradle version and plugin were recently upgraded to 3.1.3 and 4.4 respectively.
Now while compiling, I am getting an error of 'unresolved reference' in a few of the Kotlin files.
Eg. -
return when (item?.itemId) {
android.R.id.home -> {
finish()
true
}
else -> super.onOptionsItemSelected(item)
}
In the above code getting compilation error in android.R.id.home as unresolved reference.
Also in
root_low_rating_nps.viewTreeObserver.removeOnGlobalLayoutListener(keyboardLayoutListener)
Getting the 'unresolved reference' error in finding 'removeOnGlobalLayoutListener'
I have been stuck on this for 5 days.
Tried moving the Kotlin buildscript dependencies in the app module's build.gradle, invalidate caches and restart, refresh, deleting .idea/ folder.
Can anyone help resolve this issue?
Thanks
./gradlew assembleDebug.