I'm trying to use butter knife but having trouble with the generated code. It's complaining with a namespace... I don't know why.
error: cannot find symbol class Detail
To simplify see all peaces, I take a print. Can you help me?
Oddly enough, @BindView doesn't complain of any error. I am importing butterknife.BindView but have also tried importing butterknife.* to no avail. I've got version 8.4.0 of butterknife-compiler in the build.gradle file.
The cannot find symbol error, also found under the names of symbol not found and cannot resolve symbol, is a Java compile-time error which emerges whenever there is an identifier in the source code which the compiler is unable to work out what it refers to.
When uses of these identifiers are encountered in the source code, the compiler looks them up in the symbol tables and relies on this information for things such as verifying that a variable has been declared, determining the scope of a variable, and verifying that an expression is semantically correct with type checking.
The root cause for the cannot find symbol Java error can occasionally be found in some unexpected or obscure places. Such is the case with accidental semicolons that terminate a statement ahead of time (Fig. 5), or when object creation is attempted without a proper constructor invocation which has to have the new keyword (Fig. 6).
Make sure the version of the ButterKnife library matches the apt plugin version like this:
compile 'com.jakewharton:butterknife:8.5.1'
apt 'com.jakewharton:butterknife-compiler:8.5.1'
Please follow this link while adding ButterKnife to your build.gradle file:
https://github.com/JakeWharton/butterknife
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With