I know a similar question has been answered Here. But that was due to butter knife library problem but my case is different. In my case when I use dagger injected properties
You can't use an object before you initialize it.
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) // prefs called in parents onCreate!
setContentView(R.layout.activity_login)
AndroidInjection.inject(this) // injection happens here
Get your calls in order. Easiest way to fix would be to move AndroidInjection.inject(this)
before the call to super.onCreate(...)
.