Quyunshuo / AndroidBaseFrameMVVM

基于 Jetpack + Kotlin 的 Android 组件化 MVVM 框架

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Caused by: java.lang.InstantiationException: java.lang.Class<.ui.splash.SplashViewModel> has no zero argument constructor

Lans opened this issue · comments

commented
@HiltViewModel
open class SplashViewModel @Inject constructor(private val splashRepository: SplashRepository) : BaseViewModel() 

class SplashRepository @Inject constructor() : BaseRepository()

 override val mViewModel: SplashViewModel by viewModels()

  通过by viewModels()  splashRepository这个注解不上去