When designing my own custom view and try to check...
# android
d
When designing my own custom view and try to check preview in AS I get following exception:
Copy code
ava.lang.IncompatibleClassChangeError: Found class kotlin.Lazy, but interface was expected
  at my.package.MyCustomView.getEdit(MyCustomView.kt:71)
  at my.package.MyCustomView.init(MyCustomView.kt:41)
  at my.package.MyCustomView.init$default(MyCustomView.kt:37)
  at my.package.MyCustomView.<init>(MyCustomView.kt:26)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
  at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:835)
  at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
Where
edit
declared as:
Copy code
val edit by lazy { findViewById(R.id.edit) as EditText }
What can be the reason of this?