Closed egor-n closed 9 years ago
Android Studio does not pick up generated sources automatically. Basically you have to change the output directory for generated sources and tell AS that that folder is a source folder. You might be interested in https://bitbucket.org/hvisser/android-apt or https://github.com/stanfy/gradle-android-apt
It's normal, I don't think the idea looks in the build folder while gradle does.
Use one of the aforementioned plugins.
Alright, thank you! android-apt seems to work for me. Should it maybe be added in the README a heads up for people like myself?
Yes. Documenting Dagger 2 has only just begun.
Please do so we don't have to beg for it on SO :+1:
While these plugins work and projects build just right, created classes are not being picked up by IntelliJ so they're marked down as not found, disabling static code checks.
IntelliJ should be able to see the generated types. Take a look at https://github.com/gk5885/dagger-android-sample and see if that configuration works for you.
Android Studio 1.0-RC1
But I was tinkering with it on IntelliJ14 at home over the weekend and it didn't work either.
Project Lombok uses an IDE plugin to circumvent the checks and allow operations on annotated fields, but I don't know if it applies here.
cannot resolve symbol 'Dagger_...' in eclipse too
I configured the annotation processing but it doesn't work
eclipse Version: Kepler Service Release 1 Build id: 20130919-0819
IntelliJ should be able to see the generated types. Take a look at https://github.com/gk5885/dagger-android-sample and see if that configuration works for you.
I had the same problem with symbols not resolved, but after adding apt plugin as in sample everything worked fine.
I'm using IntelliJ Idea 14.0.2
You can try my sample project https://github.com/mgrzechocinski/dagger2-example Sample contains retrolambda&lombok configuration as well.
Be aware, that you have to add com.neenbedankt.android-apt
to your project.
Now struggling on IntelliJ :/ Added apt plugin, enabled annotation processor, marked generated folder as source. But i can't really see any generated file
These are very old instructions. You should not be using apt-plugin today, the functionality is built into the android build plugin (using the keyword annotationProcessor instead of apt in dependencies)
@liminal i am not talking about android, i am using dagger for pure java project on IntelliJ
@jemshit Assuming net.ltgt.apt
plugin, make sure you also apply net.ltgt.apt-idea
. I also suggest delegating build/run actions to Gradle in IntelliJ (beware, this is a global setting, not actually per-project) so you don't even have to configure annotation processing in IntelliJ; you should then set idea.module.apt.addAptDependencies = false
. See https://github.com/tbroyer/gradle-apt-plugin#intellij-idea, come discuss at https://github.com/tbroyer/gradle-apt-plugin/issues if you still have issues (though please review previous issues, particularly those labelled as invalid
or question
)
Android Studio 0.9.3 Gradle 2.1 Gradle Plugin 0.14.2
Is it supposed to be this way? It's red, but compiles with no problem.