mercredi 28 septembre 2022

Kotlin Class Reflection Not Working in .kt File

I have a .kt Fragment file in my project and I'm trying to start a new activity with the following code:

profilePref?.setOnPreferenceClickListener {
            val profileIntent = Intent(activity, ProfileActivity::class.java)
            startActivity(profileIntent)
            true
        }

I have included both

implementation ("org.jetbrains.kotlin:kotlin-reflect:1.7.10")

in my module build.gradle and

classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"

in my project build.gradle, but the class.java still gives me unresolved reference and I'm not really sure why, any help would be appreciated.





Aucun commentaire:

Enregistrer un commentaire