Gradle & Dagger: Add dagger code generation to android library and app

Edit: A newer and simpler method, is published in this blog post. Recommend you use that method.

Before gradle better support annotation processors, you need a workaround to make: 1). dagger code generation working with android project; 2). Make really reusable dagger Modules if you have multiple APK projects.

There is a solution here Issue #319. However, it doesn’t address requirement #2.

So here is my solution. First, the library build.gradle:

Then for the APK project, the setup is pretty much clone of a solution in Issue #319. Here it goes:

This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to Gradle & Dagger: Add dagger code generation to android library and app

    • frankdu says:

      Thank you Giulio! I am putting up an tutorial, which has simplified config. I will incorporate some knowledge I learned from Ori Peleg, which is Onavo Android developer.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">