I am trying to create a viewmodel module like in this example but I am having this error
error: java.util.Map,javax.inject.Provider> cannot be provid
You need to bind your view models using Dagger multibindings. In other words, bind your view models and annotate them with the @IntoMap
multibinding annotation. In the same example you posted, you can find an example of it here. In the example, they created the ViewModelKey
annotation in order to specify the key from which Dagger can retrieve your view model from the map (usually the view model's class). Dagger will create the map at compile time, and that's why you get the error - if you don't specify any view model to be part of the map, Dagger can't know which types it should instantiate.