Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJ A
Full Stack JavaScript Techdegree Student 4,646 PointsCannot find symbol class InjectView
Like the title says, that annotation doesn't seem to want to compile. I was using the latest version of Butterknife at the time of this writing (version 8), and also tried falling back to version 6 as in the video, but that didn't work either.
Am I missing an import? I've tried clearing the build cache and rebuilding with Gradle with no success. What else can I do?
2 Answers
J A
Full Stack JavaScript Techdegree Student 4,646 PointsI see InjectView now is BindView.
Boban Talevski
24,793 PointsIt should be
ButterKnife.bind(this);
instead of
ButterKnife.inject(this);
zaki bhai
163 Pointszaki bhai
163 PointsWhat about this ButterKnife.inject(this);
Oziel Perez
61,321 PointsOziel Perez
61,321 PointsWhat J A is saying is that if you (or anyone) is using the latest version of ButterKnife at the time of this comment, the inject static method is know 'bind'. @InjectView is now @BindView. The function of the code remains pretty much the same.