question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot Find Symbol DaggerApp_HiltComponents_SingletonC.builder()

See original GitHub issue

Need 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:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
sdzshn3commented, May 29, 2021

Hey @PykeChen Try adding this into gradle.properties

kapt.use.worker.api=false kapt.incremental.apt=false

1reaction
zakayothukucommented, Nov 4, 2020

Since adding api instead of implementation is not an option for us for our core module, I had to put some of the required libraries in both app and core module.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found