Skip to content

Instantly share code, notes, and snippets.

@freaksgit
Last active April 25, 2018 17:56
Show Gist options
  • Save freaksgit/713c13fb31f3df2d41c1c32aab726dcb to your computer and use it in GitHub Desktop.
Save freaksgit/713c13fb31f3df2d41c1c32aab726dcb to your computer and use it in GitHub Desktop.
public class App extends DaggerApplication {
@Inject
OnFirstRunUseCase onFirstRunUseCase;
@Override
public void onCreate() {
super.onCreate();
((AppComponent) applicationInjector()).inject(app); //solving
onFirstRunUseCase.execute(() -> {}, throwable -> {});
}
@Override
protected AndroidInjector<? extends DaggerApplication> applicationInjector() {
return DaggerAppComponent
.builder()
.application(this)
.build();
}
}
//----Logcat Output----//
java.lang.RuntimeException: Unable to create application xx.xx.xxx.App:
java.lang.NullPointerException: Attempt to invoke virtual method
'void OnFirstRunUseCase.execute(io.reactivex.functions.Action,
io.reactivex.functions.Consumer)' on a null object reference
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment