package com.aa.safe.safehei.activities;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import com.aa.safe.safe.R;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class DogActivity extends AppCompatActivity {
@BindView(R.id.tv_islocked_notselect)
TextView mTvIslockedNotselect;
@BindView(R.id.tv_islocked_select)
TextView mTvIslockedSelect;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dog);
ButterKnife.bind(this);
}
}
使用butterknife后
在app/build/generated/source/apt/debug/包名/DogActivity$$ViewBinder
下提示报错
import butterknife.internal.Finder;
import butterknife.internal.ViewBinder;
提示这二个类找不到,我看了下的确是没有的
messages 窗口也提示找不到符号........
What version are you using? This is 7.0.1
compile 'com.jakewharton:butterknife:7.0.1'
butterknife cannot be used in the library project, I don’t know if this is the case for you,
The 8.1.0 version I use needs to add apt 'com.jakewharton:butterknife-compiler:8.1.0'
in gradle. It is used for pre-compilation. I don’t know if it is required for 7.0