1

I have a main activity as below:

@AndroidEntryPoint
class MainActivity : BaseActivity() {

  @Inject
  lateinit var configuration: Configuration

  ...
}

And a module defined like:

@Module
@InstallIn(SingletonComponent::class)
class AppModules {

 @Singleton

 @Provides
    fun bindDeviceConfig(): Configuration {
        return Configuration()
    }
}

When I try running this it gives an error:

lateinit property configuration has not been initialized

I've looked at the documentation and can't seem to get my head around why I'm getting this issue. Does anyone know why?

KTOV
  • 559
  • 3
  • 14
  • 39

0 Answers0