paint-brush
Issues faced when setup Dagger 2 on Kotlinby@elye.project
696 reads
696 reads

Issues faced when setup Dagger 2 on Kotlin

by ElyeApril 25th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

After setup Kotlin (as per this <a href="https://medium.com/@elye.project/setup-dagger-2-on-kotlin-project-d48d28dcc89e">article</a>), I faced several issues, and have them resolve. I’m stating them here as reference to all who encounter the&nbsp;same…

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Issues faced when setup Dagger 2 on Kotlin
Elye HackerNoon profile picture

After setup Kotlin (as per this article), I faced several issues, and have them resolve. I’m stating them here as reference to all who encounter the same…

Error: java.lang.NullPointerException (no error message)

Upon first compilation, you’ll see this error keep occuring. Don’t know why it happens. Apparently, you just need to delete and clean your gradle (Build →Clean Project), and recompile, then the error should go away.

Warning: Dagger 2.2 component builder module method deprecated

If you just setup your project with Dagger without actually using any of the injected object, you might see the above warning. Don’t worry, this is just a feature generated by Dagger to warn you of unused module. Check out the Stack Overflow below to discover how you could confirm that’s indeed the case.

Dagger 2.2 component builder module method deprecated

Warning: the ‘-d’ option with a directory destination is ignored because ‘-module’ is specified

This warning is actually a Kotlin bug. It doesn’t exist in Kotlin version 1.0.5, but was found in 1.1.1 (introduced something in between). However it should be fixed in Kotlin version 1.1.2 as mentioned in the StackOverflow below.

Warning:the '-d' option with a directory destination is ignored because '-module' is specified

That’s all I encountered. If you found more issues, feel free to share with me, an hopefully with the resolution as well. I could shared with others and .

Click “❤” below to share. Thanks! ~Twitter:elye; Facebook:elye