Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Step 7 Provide context #38

Open
aidanmack opened this issue Jul 19, 2020 · 1 comment
Open

Step 7 Provide context #38

aidanmack opened this issue Jul 19, 2020 · 1 comment

Comments

@aidanmack
Copy link

In step 7 it goes into detail about how to provide a context
it tells us...
The way to pass it in is with a Component Factory and using the @BindsInstance annotation.

If I build straight after this i get the error...
android.content.Context cannot be provided without an @Provides-annotated method.

To fix this issue I annoted property in the class that context is used like so..

class SomeClass @Inject constructor( @ApplicationContext private val context: Context )

@Shijilal
Copy link

Shijilal commented Sep 15, 2020

@aidanmack i think you are missing @Component.Factory annotation above the interface Factory.
I too missed that and got the same error

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

No branches or pull requests

2 participants