android – 导入butterknife.InjectView无法解析

android – 导入butterknife.InjectView无法解析,第1张

概述我试图使用 this library project,所以我尝试运行示例应用程序(在/ app / source / main /在Github链接中),在MainActivity.java中,我收到导入错误 import butterknife.InjectView; 而且在MainActivity.java和VerticalLinearRecyclerViewSample.java中,每次出现 我试图使用 this library project,所以我尝试运行示例应用程序(在/ app / source / main /在Github链接中),在MainActivity.java中,我收到导入错误
import butterknife.InjectVIEw;

而且在MainActivity.java和VerticallinearRecyclerVIEwSample.java中,每次出现@InjectVIEw(…)注释时,都会出现以下错误:

InjectVIEw cannot be resolved to a type

那我该怎么办呢?

我做了什么:

我见过this question.没有为我工作,在那里发表评论.

我有followed these steps to include the Butter Knife library到第3步.关于步骤#4,“确保.apt_generated /文件夹位于项目根目录…” – 此项目没有任何名为.apt-generated的文件夹或项目根文件夹中的内容.

注意:我实际上使用Eclipse,而Github上的项目是针对AndroID Stu@R_403_6901@的,因此我在eclipse中创建了一个新项目,并从下载的AndroID Stu@R_403_6901@项目中复制了单个文件.我希望这没有什么不同.

解决方法 感谢@Sharj首先回答.

Butterknife 7.0.0版本包括重命名注释动词的重大变化.这在更改日志中突出显示并反映在网站中.

Version 7.0.0 *(2015-06-27)*---------------------------- * `@Bind` replaces `@InjectVIEw` and `@InjectVIEws`. * `ButterKnife.bind` and `ButterKnife.unbind` replaces `ButterKnife.inject`     and `ButterKnife.reset`,respectively....

https://github.com/JakeWharton/butterknife/blob/f65dc849d80f6761d1b4a475626c568b2de883d9/CHANGELOG.md

总结

以上是内存溢出为你收集整理的android – 导入butterknife.InjectView无法解析全部内容,希望文章能够帮你解决android – 导入butterknife.InjectView无法解析所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1138634.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-31
下一篇2022-05-31

发表评论

登录后才能评论

评论列表(0条)

    保存