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.
Tiago Gouvêa
  • 15,036
  • 4
  • 75
  • 81

2 Answers2

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

Mick
  • 30,759
  • 16
  • 111
  • 130
Sachin Rana
  • 381
  • 1
  • 7
  • 17
  • 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 :) – Sudheesh Mohan Jul 30 '16 at 17:21
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.

Tiago Gouvêa
  • 15,036
  • 4
  • 75
  • 81