i'm trying create app component, dagger not generate app component. here myapplication class
class myapplication : application() { companion object { @jvmstatic lateinit var graph: applicationcomponent } @inject lateinit var locationmanager : locationmanager override fun oncreate() { super.oncreate() graph = daggerapplicationcomponent.builder().appmodule(appmodule(this)).build() graph.inject(this) } }
and here appcomponent class
@singleton @component(modules = arrayof(appmodule::class)) interface applicationcomponent { fun inject(application: myapplication) }
this project on github
here error log
error:(7, 48) unresolved reference: daggerapplicationcomponent error:(28, 17) unresolved reference: daggerapplicationcomponent error:execution failed task ':app:compiledebugkotlin'. > compilation error. see log more details information:build failed information:total time: 21.184 secs error:e: .../myapplication.kt: (7, 48): unresolved reference: daggerapplicationcomponent e: unresolved reference: daggerapplicationcomponent failure: build failed exception. * went wrong: execution failed task ':app:compiledebugkotlin'. > compilation error. see log more details * try: run --stacktrace option stack trace. run --info or --debug option more log output. information:4 errors information:0 warnings information:see complete output in console
please try enabling stubs generation, might reason why class not visible @ stage of build process. in build.gradle
file, top level:
kapt { generatestubs = true }
Comments
Post a Comment