Git Product home page Git Product logo

Comments (16)

roman-mazur avatar roman-mazur commented on April 28, 2024

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.

daverix avatar daverix commented on April 28, 2024

It's normal, I don't think the idea looks in the build folder while gradle does.

from dagger.

JakeWharton avatar JakeWharton commented on April 28, 2024

Use one of the aforementioned plugins.

from dagger.

egor-n avatar egor-n commented on April 28, 2024

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.

JakeWharton avatar JakeWharton commented on April 28, 2024

Yes. Documenting Dagger 2 has only just begun.

from dagger.

pakoito avatar pakoito commented on April 28, 2024

Please do so we don't have to beg for it on SO 👍

from dagger.

pakoito avatar pakoito commented on April 28, 2024

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.

gk5885 avatar gk5885 commented on April 28, 2024

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.

pakoito avatar pakoito commented on April 28, 2024

Android Studio 1.0-RC1

No

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.

gitcore avatar gitcore commented on April 28, 2024

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.

marwinxxii avatar marwinxxii commented on April 28, 2024

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.

mgrzechocinski avatar mgrzechocinski commented on April 28, 2024

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.

jemshit avatar jemshit commented on April 28, 2024

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.

liminal avatar liminal commented on April 28, 2024

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.

jemshit avatar jemshit commented on April 28, 2024

@liminal i am not talking about android, i am using dagger for pure java project on IntelliJ

from dagger.

tbroyer avatar tbroyer commented on April 28, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.