Cannot find ButterKnife.bind in Butterknife












0















I include the butterknife library in my project




implementation 'com.jakewharton:butterknife:9.0.0-rc1'




*************UPDATE********
Added annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1' still not work.



It shows the following error message when building




21:26:51.121 [ERROR] [system.err] E:workspacecompanygitshopglobalandroidSmartappsrcmainjavacompackagesmartscenenewactiivitySmartActivity.java:150: 错误: 找不到符号



21:26:51.121 [ERROR] [system.err] ButterKnife.bind(this);



21:26:51.121 [ERROR] [system.err] ^



21:26:51.121 [ERROR] [system.err] 符号: 方法 bind(SmartActivity)




But strangely I can view the source code in the android studio, and the ButterKnife jar is in the right place:




.gradlecachestransforms-1files-1.1butterknife-9.0.0-rc1.aar




It shows normal.



enter image description here










share|improve this question

























  • can you mention gradle file?

    – Abhinav Gupta
    Nov 14 '18 at 13:43











  • Don't use ButterKnife. Use DataBinding.

    – Obsthändler
    Nov 14 '18 at 13:45
















0















I include the butterknife library in my project




implementation 'com.jakewharton:butterknife:9.0.0-rc1'




*************UPDATE********
Added annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1' still not work.



It shows the following error message when building




21:26:51.121 [ERROR] [system.err] E:workspacecompanygitshopglobalandroidSmartappsrcmainjavacompackagesmartscenenewactiivitySmartActivity.java:150: 错误: 找不到符号



21:26:51.121 [ERROR] [system.err] ButterKnife.bind(this);



21:26:51.121 [ERROR] [system.err] ^



21:26:51.121 [ERROR] [system.err] 符号: 方法 bind(SmartActivity)




But strangely I can view the source code in the android studio, and the ButterKnife jar is in the right place:




.gradlecachestransforms-1files-1.1butterknife-9.0.0-rc1.aar




It shows normal.



enter image description here










share|improve this question

























  • can you mention gradle file?

    – Abhinav Gupta
    Nov 14 '18 at 13:43











  • Don't use ButterKnife. Use DataBinding.

    – Obsthändler
    Nov 14 '18 at 13:45














0












0








0








I include the butterknife library in my project




implementation 'com.jakewharton:butterknife:9.0.0-rc1'




*************UPDATE********
Added annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1' still not work.



It shows the following error message when building




21:26:51.121 [ERROR] [system.err] E:workspacecompanygitshopglobalandroidSmartappsrcmainjavacompackagesmartscenenewactiivitySmartActivity.java:150: 错误: 找不到符号



21:26:51.121 [ERROR] [system.err] ButterKnife.bind(this);



21:26:51.121 [ERROR] [system.err] ^



21:26:51.121 [ERROR] [system.err] 符号: 方法 bind(SmartActivity)




But strangely I can view the source code in the android studio, and the ButterKnife jar is in the right place:




.gradlecachestransforms-1files-1.1butterknife-9.0.0-rc1.aar




It shows normal.



enter image description here










share|improve this question
















I include the butterknife library in my project




implementation 'com.jakewharton:butterknife:9.0.0-rc1'




*************UPDATE********
Added annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1' still not work.



It shows the following error message when building




21:26:51.121 [ERROR] [system.err] E:workspacecompanygitshopglobalandroidSmartappsrcmainjavacompackagesmartscenenewactiivitySmartActivity.java:150: 错误: 找不到符号



21:26:51.121 [ERROR] [system.err] ButterKnife.bind(this);



21:26:51.121 [ERROR] [system.err] ^



21:26:51.121 [ERROR] [system.err] 符号: 方法 bind(SmartActivity)




But strangely I can view the source code in the android studio, and the ButterKnife jar is in the right place:




.gradlecachestransforms-1files-1.1butterknife-9.0.0-rc1.aar




It shows normal.



enter image description here







android butterknife






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 15:23







mianlaoshu

















asked Nov 14 '18 at 13:43









mianlaoshumianlaoshu

4931721




4931721













  • can you mention gradle file?

    – Abhinav Gupta
    Nov 14 '18 at 13:43











  • Don't use ButterKnife. Use DataBinding.

    – Obsthändler
    Nov 14 '18 at 13:45



















  • can you mention gradle file?

    – Abhinav Gupta
    Nov 14 '18 at 13:43











  • Don't use ButterKnife. Use DataBinding.

    – Obsthändler
    Nov 14 '18 at 13:45

















can you mention gradle file?

– Abhinav Gupta
Nov 14 '18 at 13:43





can you mention gradle file?

– Abhinav Gupta
Nov 14 '18 at 13:43













Don't use ButterKnife. Use DataBinding.

– Obsthändler
Nov 14 '18 at 13:45





Don't use ButterKnife. Use DataBinding.

– Obsthändler
Nov 14 '18 at 13:45












1 Answer
1






active

oldest

votes


















1














From your post, you only added the library and not the annotation processor. Add this
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1' to your gradle file - preferably beneath your Butterknife dependency. Build your project.



Your Butterknife library should look like this:



dependencies {
....
implementation 'com.jakewharton:butterknife:9.0.0-rc1'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
}


Good luck!






share|improve this answer


























  • Added the annotationProcessor following the instruction. But still cannot find ButterKnife.bind.....It can resolve the @BindView, but cannot find the ButterKnife.bind method. I invalidate the cache and clean the project. Still not work...Very strange

    – mianlaoshu
    Nov 14 '18 at 15:21











  • Check your logs, what error(s) are you getting?

    – DevMike01
    Nov 14 '18 at 15:38











  • I found why this happened. There exists a 3rd module, which adds a butterknife library. It puts the old-version butterknife jar under its libs dir, not imports from the gradle....sorry for that. Thank you!

    – mianlaoshu
    Nov 15 '18 at 2:39











  • You're welcome. I'm glad it works for you.

    – DevMike01
    Nov 15 '18 at 5:37











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53301651%2fcannot-find-butterknife-bind-in-butterknife%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














From your post, you only added the library and not the annotation processor. Add this
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1' to your gradle file - preferably beneath your Butterknife dependency. Build your project.



Your Butterknife library should look like this:



dependencies {
....
implementation 'com.jakewharton:butterknife:9.0.0-rc1'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
}


Good luck!






share|improve this answer


























  • Added the annotationProcessor following the instruction. But still cannot find ButterKnife.bind.....It can resolve the @BindView, but cannot find the ButterKnife.bind method. I invalidate the cache and clean the project. Still not work...Very strange

    – mianlaoshu
    Nov 14 '18 at 15:21











  • Check your logs, what error(s) are you getting?

    – DevMike01
    Nov 14 '18 at 15:38











  • I found why this happened. There exists a 3rd module, which adds a butterknife library. It puts the old-version butterknife jar under its libs dir, not imports from the gradle....sorry for that. Thank you!

    – mianlaoshu
    Nov 15 '18 at 2:39











  • You're welcome. I'm glad it works for you.

    – DevMike01
    Nov 15 '18 at 5:37
















1














From your post, you only added the library and not the annotation processor. Add this
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1' to your gradle file - preferably beneath your Butterknife dependency. Build your project.



Your Butterknife library should look like this:



dependencies {
....
implementation 'com.jakewharton:butterknife:9.0.0-rc1'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
}


Good luck!






share|improve this answer


























  • Added the annotationProcessor following the instruction. But still cannot find ButterKnife.bind.....It can resolve the @BindView, but cannot find the ButterKnife.bind method. I invalidate the cache and clean the project. Still not work...Very strange

    – mianlaoshu
    Nov 14 '18 at 15:21











  • Check your logs, what error(s) are you getting?

    – DevMike01
    Nov 14 '18 at 15:38











  • I found why this happened. There exists a 3rd module, which adds a butterknife library. It puts the old-version butterknife jar under its libs dir, not imports from the gradle....sorry for that. Thank you!

    – mianlaoshu
    Nov 15 '18 at 2:39











  • You're welcome. I'm glad it works for you.

    – DevMike01
    Nov 15 '18 at 5:37














1












1








1







From your post, you only added the library and not the annotation processor. Add this
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1' to your gradle file - preferably beneath your Butterknife dependency. Build your project.



Your Butterknife library should look like this:



dependencies {
....
implementation 'com.jakewharton:butterknife:9.0.0-rc1'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
}


Good luck!






share|improve this answer















From your post, you only added the library and not the annotation processor. Add this
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1' to your gradle file - preferably beneath your Butterknife dependency. Build your project.



Your Butterknife library should look like this:



dependencies {
....
implementation 'com.jakewharton:butterknife:9.0.0-rc1'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
}


Good luck!







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 15 '18 at 5:40

























answered Nov 14 '18 at 13:55









DevMike01DevMike01

7641819




7641819













  • Added the annotationProcessor following the instruction. But still cannot find ButterKnife.bind.....It can resolve the @BindView, but cannot find the ButterKnife.bind method. I invalidate the cache and clean the project. Still not work...Very strange

    – mianlaoshu
    Nov 14 '18 at 15:21











  • Check your logs, what error(s) are you getting?

    – DevMike01
    Nov 14 '18 at 15:38











  • I found why this happened. There exists a 3rd module, which adds a butterknife library. It puts the old-version butterknife jar under its libs dir, not imports from the gradle....sorry for that. Thank you!

    – mianlaoshu
    Nov 15 '18 at 2:39











  • You're welcome. I'm glad it works for you.

    – DevMike01
    Nov 15 '18 at 5:37



















  • Added the annotationProcessor following the instruction. But still cannot find ButterKnife.bind.....It can resolve the @BindView, but cannot find the ButterKnife.bind method. I invalidate the cache and clean the project. Still not work...Very strange

    – mianlaoshu
    Nov 14 '18 at 15:21











  • Check your logs, what error(s) are you getting?

    – DevMike01
    Nov 14 '18 at 15:38











  • I found why this happened. There exists a 3rd module, which adds a butterknife library. It puts the old-version butterknife jar under its libs dir, not imports from the gradle....sorry for that. Thank you!

    – mianlaoshu
    Nov 15 '18 at 2:39











  • You're welcome. I'm glad it works for you.

    – DevMike01
    Nov 15 '18 at 5:37

















Added the annotationProcessor following the instruction. But still cannot find ButterKnife.bind.....It can resolve the @BindView, but cannot find the ButterKnife.bind method. I invalidate the cache and clean the project. Still not work...Very strange

– mianlaoshu
Nov 14 '18 at 15:21





Added the annotationProcessor following the instruction. But still cannot find ButterKnife.bind.....It can resolve the @BindView, but cannot find the ButterKnife.bind method. I invalidate the cache and clean the project. Still not work...Very strange

– mianlaoshu
Nov 14 '18 at 15:21













Check your logs, what error(s) are you getting?

– DevMike01
Nov 14 '18 at 15:38





Check your logs, what error(s) are you getting?

– DevMike01
Nov 14 '18 at 15:38













I found why this happened. There exists a 3rd module, which adds a butterknife library. It puts the old-version butterknife jar under its libs dir, not imports from the gradle....sorry for that. Thank you!

– mianlaoshu
Nov 15 '18 at 2:39





I found why this happened. There exists a 3rd module, which adds a butterknife library. It puts the old-version butterknife jar under its libs dir, not imports from the gradle....sorry for that. Thank you!

– mianlaoshu
Nov 15 '18 at 2:39













You're welcome. I'm glad it works for you.

– DevMike01
Nov 15 '18 at 5:37





You're welcome. I'm glad it works for you.

– DevMike01
Nov 15 '18 at 5:37




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53301651%2fcannot-find-butterknife-bind-in-butterknife%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Bressuire

Vorschmack

Quarantine