Butterknife does not create anything in .apt_generated directory
Asked Answered
R

2

1

I am trying to use Butterknife for injection, but I do not see any classes generated in the .apt_generated directory.

I am using eclipse Kepler (service release 2), enabled annotation processing in my project properties and defined the butterknife-5.0.0.jar as the annotation processor in the factory path.

I have 2 views injected into a fragment for testing, and when I clean the project it is built but nothing is generated. Checking the log file and the error_log view I don't see anything related..

Any ideas?

Reeder answered 25/4, 2014 at 8:31 Comment(3)
Can you compile and run your app ?Chagall
@YeLinAung Thanks, the problem was that the project did not compile due to other path problems, and I did not notice this. If you create your comment as an answer I will mark it as the correct answer.Reeder
I've added the answer. :)Chagall
C
0

I suggest to check if you compile and run your app.

Or, other parts of your codes may have some errors and the IDE isn't able to build. e.g R.java is missing etc.

Chagall answered 27/4, 2014 at 6:22 Comment(0)
D
1

First you need to make sure you have an Android project and not an Android library project because Butterknife does not support library projects. To do this click Project Properties and go to the Android section. Make sure the is Library checkbox is not clicked. For further details see:

Then check these settings in project/.factorypath:

<factorypath>
    <factorypathentry kind="WKSPJAR" id="/PotlatchClient/libs/butterknife-5.1.2.jar" enabled="true" runInBatchMode="false"/>
</factorypath>

project/.settings/org.eclipse.jdt.apt.core.prefs:

eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=true
org.eclipse.jdt.apt.genSrcDir=.apt_generated
org.eclipse.jdt.apt.reconcileEnabled=true

project/.settings/org.eclipse.jdt.core.prefs:

eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.processAnnotations=enabled

Finally do a refresh in Eclipse and clean to do a full rebuild.

Divinity answered 25/9, 2014 at 10:18 Comment(0)
C
0

I suggest to check if you compile and run your app.

Or, other parts of your codes may have some errors and the IDE isn't able to build. e.g R.java is missing etc.

Chagall answered 27/4, 2014 at 6:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.