butterknife
butterknife copied to clipboard
R2 class file not generated
R2 file not generated (and not resolved).
Env: Butterknife 8.2.1 (and also tried with 8.2.0) Android Build Plugin : 2.10
@JakeWharton I found a solution. The error occurs with classpath 'com.android.tools.build:gradle:2.1.0'
but not with classpath 'com.android.tools.build:gradle:2.1.2
.
This should likely be added in the documentation
This should likely be added in the documentation
No it should be fixed, but there's not really enough information to figure out what's going on here. Can you reproduce the issue in a sample project we can look at?
For what it's worth I've had no issues with 2.1.0 and Butter Knife 8.2.1 for library projects. I would take a look at https://github.com/JakeWharton/butterknife/blob/master/sample/library/build.gradle to see if you might be missing something.
In my case , both 2.1.0 and 2.1.2 have problem. R2 file not generated
@330939204 Try doing ./gradlew clean
and building again, that solved it for me.
@NickFirmani clean doens't work for me R2 doesn't create on 2.1.0 and 2.1.2
R2 not getting created did any one find the solution even i am not able to use jackson
I just experienced this problem too.
Butterknife 8.4.0 Windows 10 AS 2.2.2
The ./gradlew clean did not help either.
I did not have time to try much more and I just got an upgrade for AS to 2.2.3, afterwards it appeared without any hassle.
I solved by making a fresh gradle build with commands:
clean assembleDebug
I solved this by upgrading to 8.2.1. (Due to project requirement I can not use annotationProcessor)
I have solved this issue, Just follow these steps:
-
Add dependency correctly
implementation 'com.jakewharton:butterknife:10.2.1'. annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1' kapt 'com.jakewharton:butterknife-compiler:10.2.1'
//then add a plugin at the bottom: apply plugin: 'com.jakewharton.butterknife'
----> follow Butterknife dependency doc.
- In the terminal write: ./gradlew clean and rebuild project
This will surely help!