1

MainActivity.kt: (41, 16): Unresolved reference: setLifecycleOwner

Task :app:buildInfoGeneratorDebug

My app uses AndroidX, in my gradle.properties:

android.useAndroidX=true
android.enableJetifier=true

My Code in onCreate function in MainActivity.tk:

val camera = findViewById<View>(R.id.camera)
    camera.setLifecycleOwner(this)

Trying to implment the CameraView.

Community
  • 1
  • 1
Suisse
  • 3,467
  • 5
  • 36
  • 59

1 Answers1

2

You cast your library view type to android basic View which hasn't such method.
You should change your findViewById<View> to findViewById<CameraView>

Merov
  • 1,028
  • 1
  • 14
  • 29