Comments (16)
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
from dagger.
It's normal, I don't think the idea looks in the build folder while gradle does.
from dagger.
Use one of the aforementioned plugins.
from dagger.
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?
from dagger.
Yes. Documenting Dagger 2 has only just begun.
from dagger.
Please do so we don't have to beg for it on SO 👍
from dagger.
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.
from dagger.
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.
from dagger.
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.
from dagger.
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
from dagger.
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
from dagger.
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.
from dagger.
Now struggling on IntelliJ :/ Added apt plugin, enabled annotation processor, marked generated folder as source. But i can't really see any generated file
from dagger.
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)
from dagger.
@liminal i am not talking about android, i am using dagger for pure java project on IntelliJ
from dagger.
@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
)
from dagger.
Related Issues (20)
- Optional bindings in a parent component can sometimes use bindings from child components HOT 2
- NullPointerException dagger.spi.shaded.androidx.room.compiler.processing.XTypeElement.getAnnotation HOT 6
- Problem with Injection of DAO HOT 1
- error: [Hilt] Could not get element for com.foo.viewModels.FooViewModel_HiltModules.BindsModule: java.lang.NullPointerException HOT 1
- Missing release notes for 2.51 HOT 1
- `LazyClassKey` doesn't work when providing a `Map<Class<*>, Provider<?>` with a scope
- @AssistedInject in ViewModel using Dagger (NOT Hilt, just dagger) does not compile: cannot be provided without an @Inject constructor or an @Provides-annotated method HOT 6
- [issue] Dagger doesn't compile or doesn't give a right error message when ViewModelFactory is implemened on Kotlin rather than on Java HOT 4
- Having an issue with Dagger Hilt Proguard Rules HOT 12
- Following dagger.dev tutorial doesnt create singleton in v2.51 HOT 2
- Multibinding with Nested Complex Keys uses the wrong AnnotationCreator HOT 1
- [Hilt] onCreate() in my Application doesn't called on Instrument test HOT 4
- [Dagger-Hilt] Error when applying obfuscation other than Proguard (Allatori) HOT 3
- error: [Hilt] Expected @AndroidEntryPoint to have a value HOT 3
- @IntoSet analog for injectable classes HOT 3
- Hilt Generated Code having not used code? HOT 2
- [Dagger-Hilt] Can't get viewModel in composable by Hilt HOT 1
- Why does Provides in a Companion Object work? HOT 6
- Update Dagger guava dependency to address CVE-2023-2976 HOT 2
- Add KMP support for @HiltViewModel annotation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dagger.