Butterknife: Null View

Created on 23 Apr 2016  Â·  14Comments  Â·  Source: JakeWharton/butterknife

Hi friends,
I get problem.
In first time I call ButterKnife.bind(this); in onCreate activity, it ok.
after that, I finish activity and then I call it from other activity. and I get error null view child. I don't know why!.
Plz help me.

Needs Info

Most helpful comment

All 14 comments

I'm getting the same issue since switching over to 8.0.0. Changed my @Bind to @BindView and now those Views are null

Did you added the new apt dependency?

I tried adding it, but I'm not sure if it's actually being included. I get the same results whether it's there or not.

I have encountered this problem too.

This will generate the Binding classes that will be called by reflexion by ButterKnife.bind(...)

plz check below snippet in your build.gradle

dependencies {
  compile 'com.jakewharton:butterknife:8.0.0'
  apt 'com.jakewharton:butterknife-compiler:8.0.0'
}

Hi,

Why we need apt here, any particular reasons?

So that the generated code is created. The compiler is no longer embedded in the runtime.

Look for *$$ViewBinder.java classes in the build/ folder. If they're not there, code generation isn't happening. You can also call ButterKnife.setDebug(true) to see whether it can find the generated classes or not.

It would be nice if bind() caused an exception if the apt dependency is missing.

Rtfm
Le 29 avr. 2016 23:21, "adi1133" [email protected] a écrit :

It would be nice if bind() caused an exception if the apt dependency is
missing.

—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/JakeWharton/butterknife/issues/492#issuecomment-215884949

Is there any option to use ButterKnife with Jack? AFAIK jack doesn't support apt, and I can't compile the project with the plugin :/

No

On Sat, Apr 30, 2016, 1:03 PM Jakub KozÅ‚owski [email protected]
wrote:

Is there any option to use ButterKnife with Jack? AFAIK jack doesn't
support apt, and I can't compile the project with the plugin :/

—
You are receiving this because you commented.

Reply to this email directly or view it on GitHub
https://github.com/JakeWharton/butterknife/issues/492#issuecomment-215979140

Was this page helpful?
0 / 5 - 0 ratings