ОШибка при добавлении строки private val inMemoryCardRepository: InMemoryCardRepository,…
- User
ОШибка при добавлении строки private val inMemoryCardRepository: InMemoryCardRepository, в чём проблема? package ru.maxi.mobile.feature.newCardTab.ui.content
import android.util.Log import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.axmor.maxi.view.main.TabType import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.CancellationException import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onStart import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import ru.maxi.mobile.business.auth.AuthInteractor import ru.maxi.mobile.business.bottomnavigation.BottomNavigationInteractor import ru.maxi.mobile.common.card.repository.inmemory.InMemoryCardRepository import ru.maxi.mobile.common.card.repository.local.LocalCardRepository import ru.maxi.mobile.common.utils.android.barcode.Barcode import ru.maxi.mobile.core.data.ReloadableData import ru.maxi.mobile.core.data.emitLoading import ru.maxi.mobile.core.data.emitRefreshing import ru.maxi.mobile.core.data.emitSuccess import ru.maxi.mobile.core.data.exception.BusinessLogicException import ru.maxi.mobile.core.data.isLoading import ru.maxi.mobile.core.data.isRefreshing import ru.maxi.mobile.core.data.isSuccess import ru.maxi.mobile.core.data.mapped import ru.maxi.mobile.core.network.utils.REQUEST_ERROR_MESSAGE import ru.maxi.mobile.entity.featurepromo.FeaturePromoType import ru.maxi.mobile.feature.analytics.model.AnalyticType import ru.maxi.mobile.feature.analytics.model.actions.AnalyticNewCardActions import ru.maxi.mobile.feature.analytics.model.events.AnalyticsGeneralEvent import ru.maxi.mobile.feature.analytics.usecase.AnalyticsUseCase import ru.maxi.mobile.feature.birthdaygifts.usecase.ClientBirthdayInteractor import ru.maxi.mobile.feature.bonusPoints.BonusPointsScreens import ru.maxi.mobile.feature.cardtab.viewmodel.GetClientCardBarcodeUseCase import ru.maxi.mobile.feature.chips.ChipsScreens import ru.maxi.mobile.feature.clubs.model.Club import ru.maxi.mobile.feature.newCardTab.domain.GetCardContentUseCase import ru.maxi.mobile.feature.newCardTab.domain.GetCardDataUseCase import ru.maxi.mobile.feature.newCardTab.domain.LoadCardContentUseCase import ru.maxi.mobile.feature.newCardTab.domain.MarkCardContentItemViewedUseCase import ru.maxi.mobile.feature.newCardTab.model.CardContentBanner import ru.maxi.mobile.feature.newCardTab.model.CardContentDiscountPackage import ru.maxi.mobile.feature.newCardTab.model.CardContentItemIndication import ru.maxi.mobile.feature.newCardTab.model.CardContentPrivilege import ru.maxi.mobile.feature.newCardTab.model.NewCardContent import ru.maxi.mobile.feature.newCardTab.model.NewCardContentBannerTransitionType import ru.maxi.mobile.feature.newCardTab.model.NewCardContentBannerType import ru.maxi.mobile.feature.newCardTab.model.NewCardContentDiscountPackageType import ru.maxi.mobile.feature.newCardTab.model.NewCardContentPrivilegeType import ru.maxi.mobile.feature.newCardTab.ui.content.model.NewCardContentNavigationEvent import ru.maxi.mobile.feature.newCardTab.ui.content.model.NewCardViewData import javax.inject.Inject
- Assistant
Ошибка, которую вы видите, связана с тем, что Hilt не может найти метод для получения
inMemoryCardRepository. Вот несколько шагов, которые могут помочь вам устранить эту проблему:- Проверка зависимостей: Убедитесь, что у вас в проекте правильно настроены зависимости Hilt и что все необходимые модули правильно добавлены. Проверьте, что ваш модуль, предоставляющий , существует и правильно аннотирован.
- User
- Assistant
Ваша реализация
InMemoryCardRepositoryвыглядит корректно, однако проблема, с которой вы столкнулись, скорее всего связана не с самим репозиторием, а с тем, как он зарегистрирован в Hilt или с конфигурацией проекта. - User
Возможно стоит добавить его сюда? package ru.maxi.mobile.feature.newCardTab.di
import dagger.Binds import dagger.Module import dagger.Provides import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent import retrofit2.Retrofit import ru.maxi.mobile.common.card.repository.inmemory.InMemoryCardRepository import ru.maxi.mobile.di.auth.AuthModule import ru.maxi.mobile.feature.city.di.CityModule import ru.maxi.mobile.feature.clubs.di.ClubsModule import ru.maxi.mobile.feature.newCardTab.repository.NewCardApiService import ru.maxi.mobile.feature.newCardTab.repository.NewRemoteCardRepository import ru.maxi.mobile.feature.newCardTab.repository.NewRemoteCardRepositoryImpl import ru.maxi.mobile.feature.newCardTab.repository.inmemory.NewInMemoryCardContentRepository import ru.maxi.mobile.feature.newCardTab.repository.inmemory.NewInMemoryCardContentRepositoryImpl import ru.maxi.mobile.feature.newCardTab.repository.local.NewLocalCardContentRepository import ru.maxi.mobile.feature.newCardTab.repository.local.NewLocalCardContentRepositoryImpl import javax.inject.Singleton
- Assistant