admin管理员组文章数量:1122832
I have an android app, that when closed, if I click on a specific pop up message, I get navigated to the splash screen. From there I get navigated to the home screen, and conditionally (checking if I came here from a pop up message) to the survey screen.
When I nav back from the survey activity to the home screen (fragment), I get the below error
org.koin.core.error.NoBeanDefFoundException: No definition found for type 'gr.avin.home.presentation.tabs.offers.OffersViewModel'. Check your Modules configuration and add missing type and/or qualifier!
OffersViewModel is part of the home fragment's tabLayout
class OffersViewModel(
@MainDispatcher
private val mainDispatcher: CoroutineDispatcher,
@DefaultDispatcher
private val defaultDispatcher: CoroutineDispatcher,
private val getOffersUseCase: GetOffersUseCase,
private val getOfferUseCase: GetOfferUseCase,
private val observeProfileUseCase: ObserveProfileUseCase,
private val offerDetailsMapper: OfferDetailsMapper
) : ViewModel() {
...
}
class OfferDetailsActivity : BaseKoinActivity<ActivityOfferDetailsBinding>(homeKoinModule) {
private val viewModel: OffersViewModel by viewModel()
...
}
class OffersFragment : BaseFragment<FragmentOffersBinding>(), ViewPagerFragmentVisibility {
private val viewModel: OffersViewModel by sharedViewModel()
private val navController: NavController by lazy { findNavController() }
private var offersListAdapter: OffersListAdapter? = null
...
}
Below is my related module
val homeKoinModule = module {
...
viewModel {
OffersViewModel(
mainDispatcher = get(named<MainDispatcher>()),
defaultDispatcher = get(named<DefaultDispatcher>()),
getOffersUseCase = get(),
getOfferUseCase = get(),
observeProfileUseCase = get(),
offerDetailsMapper = get()
)
}
...
}
I literally cannot find anything wrong. Any help?
本文标签: androidKoin NoBeanDefFoundException when navigating back from an activityStack Overflow
版权声明:本文标题:android - Koin: NoBeanDefFoundException when navigating back from an activity - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736310919a1934551.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论