gpt4 book ai didi

android - import butterknife.InjectView 无法解析

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:30:49 32 4
gpt4 key购买 nike

我正在尝试使用 this library project ,所以我尝试运行示例应用程序(在 Github 链接的 /app/source/main/ 中),在 MainActivity.java 中,我收到错误进口

import butterknife.InjectView;

并且在 MainActivity.javaVerticalLinearRecyclerViewSample.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 Studio的,所以我在eclipse中新建了一个项目,并从下载的Android Studio项目中复制了各个文件。我希望这不会产生影响。

最佳答案

首先感谢@Sharj 的回答。

Butterknife 7.0.0 版本包含重命名注释动词的重大更改。这在变更日志中突出显示并反射(reflect)在网站中。

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 - import butterknife.InjectView 无法解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31531475/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com