error: [Dagger/MissingBinding] @com.calamity.weather.di.ApplicationScope kotlinx.coroutines.CoroutineScope cannot be provided without an @Provides-annotated method. #6
I was following along the tutorial and ran into a build error.
Complete error log:
C:\Users\semyo\AndroidStudioProjects\Weather\app\build\generated\source\kapt\debug\com\calamity\weather\utils\WeatherApplication_HiltComponents.java:135: error: [Dagger/MissingBinding] @com.calamity.weather.di.ApplicationScope kotlinx.coroutines.CoroutineScope cannot be provided without an @Provides-annotated method.
public abstract static class SingletonC implements WeatherApplication_GeneratedInjector,
^
@com.calamity.weather.di.ApplicationScope kotlinx.coroutines.CoroutineScope is injected at
com.calamity.weather.data.database.WeatherDatabase.Callback(�, applicationScope)
com.calamity.weather.data.database.WeatherDatabase.Callback is injected at
com.calamity.weather.di.AppModule.provideDatabase(�, callback)
com.calamity.weather.data.database.WeatherDatabase is injected at
com.calamity.weather.di.AppModule.provideWeatherDao(db)
javax.inject.Provider<com.calamity.weather.data.dao.WeatherDao> is injected at
com.calamity.weather.ui.detailedweather.WeatherViewModel_AssistedFactory(weatherDao)
com.calamity.weather.ui.detailedweather.WeatherViewModel_AssistedFactory is injected at
com.calamity.weather.ui.detailedweather.WeatherViewModel_HiltModule.bind(factory)
java.util.Map<java.lang.String,javax.inject.Provider<androidx.hilt.lifecycle.ViewModelAssistedFactory<? extends androidx.lifecycle.ViewModel>>> is injected at
androidx.hilt.lifecycle.ViewModelFactoryModules.ActivityModule.provideFactory(�, viewModelFactories)
@dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory java.util.Set<androidx.lifecycle.ViewModelProvider.Factory> is injected at
dagger.hilt.android.internal.lifecycle.DefaultViewModelFactories.InternalFactoryFactory(�, defaultActivityFactorySet, �)
dagger.hilt.android.internal.lifecycle.DefaultViewModelFactories.InternalFactoryFactory is requested at
dagger.hilt.android.internal.lifecycle.DefaultViewModelFactories.ActivityEntryPoint.getHiltInternalFactoryFactory() [com.calamity.weather.utils.WeatherApplication_HiltComponents.SingletonC ? com.calamity.weather.utils.WeatherApplication_HiltComponents.ActivityRetainedC ? com.calamity.weather.utils.WeatherApplication_HiltComponents.ActivityC]
The following other entry points also depend on it:
dagger.hilt.android.internal.lifecycle.DefaultViewModelFactories.FragmentEntryPoint.getHiltInternalFactoryFactory() [com.calamity.weather.utils.WeatherApplication_HiltComponents.SingletonC ? com.calamity.weather.utils.WeatherApplication_HiltComponents.ActivityRetainedC ? com.calamity.weather.utils.WeatherApplication_HiltComponents.ActivityC ? com.calamity.weather.utils.WeatherApplication_HiltComponents.FragmentC][WARN] Incremental annotation processing requested, but support is disabled because the following processors are not incremental: androidx.room.RoomProcessor (DYNAMIC).
My application does something different from that of the tutorial, but I was just trying to build a structure for it.
My AppModule (I'm using SingletonComponent::class because ApplicationComponent::class was deprecated. I tried an earlier version of Hilt, but it doesn't work anyway):
I was following along the tutorial and ran into a build error.
Complete error log:
My application does something different from that of the tutorial, but I was just trying to build a structure for it.
My
AppModule
(I'm usingSingletonComponent::class
becauseApplicationComponent::class
was deprecated. I tried an earlier version of Hilt, but it doesn't work anyway):My
Database
:What might be the case here and how can I fix it?