Cannot find symbol class on Butter Knife generated code
Asked Answered
C

2

10

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?

enter image description here

  • com.phormar.android.Detail namespace exists;
  • PessoaFragment are on com.phormar.android.Detail package as well.
Cinerary answered 29/4, 2016 at 14:11 Comment(0)
C
5

I solved it just renaming the namespace Detail to detail (lower case), and all start to work again. My conclusion is that cannot have a upper case on namespace where Butter Knife are being used.

Cinerary answered 7/5, 2016 at 14:39 Comment(1)
Thanks, i had the same issue! this helped me a ton!!Chapbook
L
17

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

Laboratory answered 28/7, 2016 at 8:14 Comment(1)
Yes! This is the correct answer! No need to change namespace to lowercase. Just use the latest version of ButterKnife. Thanks for saving my time :)Cholecyst
C
5

I solved it just renaming the namespace Detail to detail (lower case), and all start to work again. My conclusion is that cannot have a upper case on namespace where Butter Knife are being used.

Cinerary answered 7/5, 2016 at 14:39 Comment(1)
Thanks, i had the same issue! this helped me a ton!!Chapbook

© 2022 - 2024 — McMap. All rights reserved.