Cannot Find Symbol DaggerApp_HiltComponents_SingletonC.builder()
See original GitHub issueNeed help.
Am building my multi-module project with Dagger-Hilt. Am getting this error:
/HiltDemo/app/build/generated/source/kapt/debug/com/app/hilt/Hilt_App.java:22: error: cannot find symbol
return DaggerApp_HiltComponents_SingletonC.builder()
^
symbol: variable DaggerApp_HiltComponents_SingletonC
Here’s the generated file with the error:
/**
* A generated base class to be extended by the @dagger.hilt.android.HiltAndroidApp annotated class. If using the Gradle plugin, this is swapped as the base class via bytecode transformation.
*/
@Generated("dagger.hilt.android.processor.internal.androidentrypoint.ApplicationGenerator")
public abstract class Hilt_App extends SplitCompatApplication implements GeneratedComponentManagerHolder {
private final ApplicationComponentManager componentManager = new ApplicationComponentManager(new ComponentSupplier() {
@Override
public Object get() {
return DaggerApp_HiltComponents_SingletonC.builder()
.applicationContextModule(new ApplicationContextModule(Hilt_App.this))
.build();
}
});
@Override
public final ApplicationComponentManager componentManager() {
return componentManager;
}
@Override
public final Object generatedComponent() {
return this.componentManager().generatedComponent();
}
@CallSuper
@Override
public void onCreate() {
// This is a known unsafe cast, but is safe in the only correct use case:
// App extends Hilt_App
((App_GeneratedInjector) generatedComponent()).injectApp(UnsafeCasts.<App>unsafeCast(this));
super.onCreate();
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
android - Cannot find symbol return ... - Stack Overflow
In my case this error caused by androidx.hilt:hilt-lifecycle-viewmodel dependency. According to Dagger Hilt Github comments:
Read more >How to Resolve The Cannot Find Symbol Error in Java - Rollbar
The cannot find symbol error refers to a situation where the Java compiler is unable to find the symbol associated with a given...
Read more >The "Cannot find symbol" Compilation Error - Baeldung
The “cannot find symbol” error comes up mainly when we try to use a variable that's not defined or declared in our program....
Read more >error: cannot find symbol return ...
error: cannot find symbol return DaggerMounty_HiltComponents_SingletonC. builder() [187615237] - Visible to Public - Issue Tracker.
Read more >What Causes “Cannot find symbol” Compilation Error in Java?
Java Cannot find symbol error is a commonly occurring error in the Java compilation process. Find out its causes and ways to resolve...
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
Hey @PykeChen Try adding this into gradle.properties
kapt.use.worker.api=false kapt.incremental.apt=false
Since adding
api
instead ofimplementation
is not an option for us for our core module, I had to put some of the required libraries in bothapp
andcore
module.