cannot be provided without an @Inject constructor or an @Provides-annotated method.

280 views
Skip to first unread message

Mohammad AttarZoghy

unread,
Mar 29, 2023, 11:42:12 AM3/29/23
to Dagger Discuss

I implemented Dagger tutorial till end of https://dagger.dev/tutorial/11-withdraw-command. In compiling the program I receive this error

java: [Dagger/MissingBinding] main.Database.Account cannot be provided without an @Inject constructor or an @Provides-annotated method. main.Database.Account is injected at main.DepositCommand(account, …) main.DepositCommand is injected at main.UserCommandsModule.depositCommand(command) java.util.Map<java.lang.String,main.Command> is injected at main.CommandRouter(commands) main.CommandRouter is injected at main.CommandProcessor(firstCommandRouter) main.CommandProcessor is requested at main.CommandProcessorFactory.commandProcessor() It is also requested at: main.WithdrawCommand(…, account, …) The following other entry points also depend on it: main.UserCommandsRouter.router() [main.CommandProcessorFactory → main.UserCommandsRouter]

I send my code as well
please help to solve this error
thanks alot 
DaggerTest.rar
Reply all
Reply to author
Forward
0 new messages