Kotlin Foo::class.java “Unresolved Reference: Java” error

后端 未结 10 1253
予麋鹿
予麋鹿 2020-12-15 17:11

I am trying to convert my Java code of HomePage.class to Kotlin. I am following the instructions on Kotlin.org:

getClass()

10条回答
  •  旧时难觅i
    2020-12-15 17:27

    I saw this in AndroidStudio with Kotlin 1.2.71 and none of the above fixed it for me.

    What sadly hilariously worked for me was closing the project, telling AndroidStudio to forget about the project and re-opening from the folder. Presto, no unresolved reference. Weird, I know.

提交回复
热议问题