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 *

ERROR: si-captcha.php plugin: GD image support not detected in PHP!

Contact your web host and ask them to enable GD image support for PHP.

ERROR: si-captcha.php plugin: imagepng function not detected in PHP!

Contact your web host and ask them to enable imagepng for PHP.

This site uses Akismet to reduce spam. Learn how your comment data is processed.