butterknife报错 cannot find method "value" cannot resolve symbol

当我们在项目中使用butterknife注解的时候,出现这样的错误一般是由于没有导包

package com.wlj.blue;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Button;

import butterknife.ButterKnife;
import butterknife.InjectView;


public class MainActivity extends AppCompatActivity {


    @InjectView(R.id.button)
    Button button1;
    @InjectView(R.id.button2)
    Button button2;
    @InjectView(R.id.button3)
    Button button3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.inject(this);

    }
}
这时候我们按着alt 键和enter键  选择第一个导入butterknife包就行了

你可能感兴趣的:(Android,错误总结,Android,开源框架,butterknife,activity)