error: Processor option -Adagger.validateTransitiveComponentDependencies needs a value
See original GitHub issueI’ve a network module with:
@Module(includes = [ApiProviders::class])
abstract class ApiModule
and
@Module
object ApiProviders {
@Provides
@Singleton
fun provideHttpLoggingInterceptor(): HttpLoggingInterceptor {
return HttpLoggingInterceptor().apply {
level = if (BuildConfig.DEBUG) HttpLoggingInterceptor.Level.BODY else HttpLoggingInterceptor.Level.BASIC
}
}
...
}
My app module with:
@Component(modules = [ApiModule::class, ...])
@Singleton
interface AppComponent : AndroidInjector<...App> {
@Component.Factory
interface Factory : AndroidInjector.Factory<...App> {
override fun create(@BindsInstance instance: ...App): AppComponent
}
}
and in its build.gradle.kts
I’ve replaced this script with:
gradle.projectsEvaluated {
tasks.withType<JavaCompile> {
options.compilerArgs.add("-Xmaxerrs=500")
options.compilerArgs.add("-Adagger.validateTransitiveComponentDependencies=ENABLED")
}
}
But or am I misusing it or something is missing because now I get this error upon ./gradlew assembleDebug --stacktrace
:
> Task :app:kaptDevDebugKotlin
error: cannot access HttpLoggingInterceptor
class file for okhttp3.logging.HttpLoggingInterceptor not found
Consult the following stack trace for details.
cannot access HttpLoggingInterceptor
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for okhttp3.logging.HttpLoggingInterceptor not found .../di/AppComponent.java:8: error: [ComponentProcessor:MiscError] dagger.internal.codegen.ComponentProcessor was unable to process this interface because not all of its dependencies could be resolved. Check for compilation errors or a circular dependency with generated code.
public abstract interface AppComponent extends dagger.android.AndroidInjector<App> {
warning: The following options were not recognized by any processor: '[-Adagger.validateTransitiveComponentDependencie, dagger.validateTransitiveComponentDependencie, kapt.kotlin.generated]'
The following options were not recognized by any processor: '[-Adagger.validateTransitiveComponentDependencie, dagger.validateTransitiveComponentDependencie, kapt.kotlin.generated]'
> Task :app:kaptDevDebugKotlin FAILED
^
If I revert the build.gradle.kts
replace, project compiles and everything is OK.
What am I doing wrong?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Dagger 2 changelog - Awesome Android | LibHunt
Sets the default value for experimentalDaggerErrorMessages back to disabled since it ... The old error message format can still be used by setting...
Read more >google/dagger dagger-2.41 on GitHub - NewReleases.io
This release fixes a recently noticed, but long-standing bug (#3136) where Dagger's processors may silently miss a scope/qualifier on a binding if the ......
Read more >Releases · google/dagger · GitHub
A fast dependency injector for Android and Java. Contribute to google/dagger development by creating an account on GitHub.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FWIW, it looks like your approach also works if you pass the value like this:
Hello @jbluntz , My configuration is simpler than yours, I’ve a module App and only this module includes other modules (A, B and C), example:
Module A
Module App
I even end up not using this flag anymore 🤔 . I was using it like this:
Have you tried with Hilt?