Gennady Denisov
Gennady Denisov
I found this 3 years old [article](https://medium.com/square-corner-blog/keeping-the-daggers-sharp-%EF%B8%8F-230b3191c3f) by @pyricau where `@Inject` is favored over `@Provides`. Probably, this should be taken into consideration.
> You can safely remove the @Inject, unfortunately Dagger doesn't error out when there are two ways to provide a binding. Creating AboutStyler requires an activity instance, which isnt available...
Same issue on macOS Big Sur Android Studio 4.2.1 Bazel 4.1 ``` ERROR: Skipping '-nolaunch_app': no such target '//:-nolaunch_app': target '-nolaunch_app' not declared in package '' defined by /path/to/BUILD.bazel ```...
Btw, I noticed, if `kt_android_library` has `//:dagger` dependency all corresponding `_Factory`s are generated. `dagger` target is `java_library`, while `//:hilt-android` is `android_library`.
It seems one can lose `android_library.exported_plugins` in: https://github.com/bazelbuild/rules_kotlin/blob/b637ddf908ca276dcfb28f02f9bd03dcb3d87238/kotlin/internal/jvm/plugins.bzl#L78 So, I changed the line to: ```kotlin elif ctx.rule.kind in ["java_library", "android_library"]: ``` Now I started to get compilation errors from Hilt:...
Here is a [demo app](https://github.com/geaden/bazel_hilt_demo) to demonstrate that hilt annotation processors are not running.
@Kernald, Btw, I noticed that you extended `Sample_BurgApplication`. Shouldn't it be `Hilt_SampleApplication`? Does the [fix](https://github.com/lukaciko/rules_kotlin/commit/c8ad68599b55c235cb6e52b9fda5ee5cd7c2527c) resolve the issue in your case?
@Kernald Thanks a lot for letting know! I thought I had wrong Hilt setup. I keep digging into the issue, but unsuccessfully so far.
https://github.com/bazelbuild/rules_kotlin/pull/351
Btw, with the latest `rules_kotlin`, Kotlin 1.5.21 and fix from #351 I'm getting: ``` error: wrong plugin option format: null, should be plugin::= ``` Updated [demo-app](https://github.com/geaden/bazel_hilt_demo)