我的as为1.5,在gradle里面用的是 com.jakewharton:butterknife:7.0.1 版本, 在gradle里面 compile 'com.jakewharton:butterknife:7.0.1' 并且ButterKnife.bind(this)之后 R.layout.activity_main,右键generate没有弹出Generate ButterKnife Injections选项,
解决方案:File -> settings -> Plugins -> Browse repositories -> ButterKnife 安装 提示重启 重启之后 -> compile 'com.jakewharton:butterknife:7.0.1' -> ButterKnife.bind(this) -> 右键R.layout.xxxxxx -> 就能看见Generate ButterKnife Injections选项,上图
在网上找了半天,我猜测原因可能是as里面并没有产生真正的映射(只是猜测,不一定对)。当我再次用这个as新开另一个project的时候,只是在gradle里面 compile 'com.jakewharton:butterknife:7.0.1' 和 ButterKnife.bind(this) 就能产生 Generate ButterKnife Injections选项了。具体不知道什么原因,知道原因的情指教