Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE On Lazy Dagger #4392

Open
wahyupermadie opened this issue Aug 15, 2024 · 0 comments
Open

NPE On Lazy Dagger #4392

wahyupermadie opened this issue Aug 15, 2024 · 0 comments

Comments

@wahyupermadie
Copy link

wahyupermadie commented Aug 15, 2024

Hi Dagger Team, I'm getting error due to NPE on Lazy Dagger

Env:

dagger 2.43.2

Error

NullPointerException: Attempt to invoke interface method 'java.lang.Object dagger.Lazy.get()' on a null object reference

This error I got in my Application class when retrieving the lazy injection, my application extend DaggerApplication

@Inject Lazy<Set<ClassA>> classA;

@Override
public void onCreate() {
    classA.get()
}

Dagger Module Example

@Module
class AppModule {
  @Provides
  @IntoSet
  fun provideClassXyz(): ClassA = ClassXyz()
}

This issue I observe in firebase crashlytics, but still not able to reproduce locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant