Kotlin: 1.1.51-release-Studio3.0-1
Andnroid Studio: 3RC1
ButterKnife: 8.8.1
I have following code
class ChatItemViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
@Nullable
@BindView(R.id.text_chat)
public var textView: TextView? = null
@Nullable
@BindView(R.id.text_chat)
lateinit var textView2: TextView
init {
ButterKnife.bind(this, itemView)
textView?.let {
TextViewCompat.setAutoSizeTextTypeWithDefaults(it, TextViewCompat.AUTO_SIZE_TEXT_TYPE_UNIFORM)
}
}
}
and getting
error: @BindView fields must not be private or static.
kotlin bytecode
// class version 50.0 (50)
// access flags 0x31
public final class com/ctrlgroup/pathway/main/ChatItemViewHolder extends android/support/v7/widget/RecyclerView$ViewHolder {
// access flags 0x2
private Landroid/widget/TextView; textView
@Landroid/support/annotation/Nullable;() // invisible
@Lbutterknife/BindView;(value=2131230875) // invisible
@Lorg/jetbrains/annotations/Nullable;() // invisible
java
@kotlin.Metadata(mv = {1, 1, 7}, bv = {1, 0, 2}, k = 1, d1 = {"...something..."}, d2 = {"Lcom/ctrlgroup/pathway/main/ChatItemViewHolder;", "Landroid/support/v7/widget/RecyclerView$ViewHolder;", "itemView", "Landroid/view/View;", "(Landroid/view/View;)V", "textView", "Landroid/widget/TextView;", "getTextView", "()Landroid/widget/TextView;", "setTextView", "(Landroid/widget/TextView;)V", "textView2", "getTextView2", "setTextView2", "app_debug"})
public final class ChatItemViewHolder extends android.support.v7.widget.RecyclerView.ViewHolder {
@org.jetbrains.annotations.Nullable()
@butterknife.BindView(value = 2131230875)
@android.support.annotation.Nullable()
private android.widget.TextView textView;
@org.jetbrains.annotations.NotNull()
@butterknife.BindView(value = 2131230875)
@android.support.annotation.Nullable()
public android.widget.TextView textView2;
Any ideas why is the textView
private ? even if i explicitly set public
Regards,