Do I have to change something in order for butterk...
# android
a
Do I have to change something in order for butterknife work with kotlin ? I am getting this err : Caused by: kotlin.UninitializedPropertyAccessException: lateinit property introIndicator0 has not been initialized
@BindView( R.id.imageview_welcome_intro_indicator_0) lateinit var introIndicator0: ImageView
k
Did you forget to call
ButterKnife#bind
?
a
I have it inside the BaseActivity
The code works fine before converting to kotlin
k
Perhaps you are attempting to use the variable before the base activity has had the chance to initialize it then
Also, did you change
annotationProcessor
in Gradle to
kapt
?
a
no
in gradle, right ?
and how to do so ?
k
There lies the problem then. Kotlin has it’s own annotation processor that should be applied instead of Android’s
annotationProcessor
. Just change all
annotationProcessor
to
kapt
and apply the kapt plugin.
apply plugin: kotlin-kapt
r
Why not just use Android Extensions?
@alouanemed were are you doing your bind(this) at?
r
Using butterknife in kotlin is not a wise. Consider using synthetic