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 Elye
Elye HackerNoon profile picture

Elye

@elye.project

April 25th, 2017
Read on Terminal Reader
Read this story in a terminal
Print this story
Read this story w/o Javascript
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
Facebook
Mention Thumbnail
Twitter
featured image - Issues faced when setup Dagger 2 on Kotlin
Elye HackerNoon profile picture
Elye

Elye

@elye.project

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

L O A D I N G
. . . comments & more!

About Author

Elye HackerNoon profile picture
Elye@elye.project

TOPICS

THIS ARTICLE WAS FEATURED IN...

Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite

Mentioned in this story

X REMOVE AD