Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

升级viewmodel到2.3.0 升级lifecycle到2.2.0 ,在LoginViewModel中如果构造函数有参数时,就会提示这个错误,不知道怎么改,是代码要修改还是google版本的bug呢 #59

Open
wyntonchin opened this issue Feb 25, 2022 · 0 comments

Comments

@wyntonchin
Copy link

Caused by: java.lang.RuntimeException: Cannot create an instance of class com.hisense.smartlab.link.tv.ui.LoginViewModel
02-25 14:56:53.059 15106 15106 E AndroidRuntime: at androidx.lifecycle.ViewModelProvider$NewInstanceFactory.create(ViewModelProvider.java:221)
02-25 14:56:53.059 15106 15106 E AndroidRuntime: at androidx.lifecycle.ViewModelProvider$AndroidViewModelFactory.create(ViewModelProvider.java:278)
02-25 14:56:53.059 15106 15106 E AndroidRuntime: at androidx.lifecycle.SavedStateViewModelFactory.create(SavedStateViewModelFactory.java:112)
02-25 14:56:53.059 15106 15106 E AndroidRuntime: at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:185)
02-25 14:56:53.059 15106 15106 E AndroidRuntime: at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:150)
02-25 14:56:53.059 15106 15106 E AndroidRuntime: at androidx.lifecycle.ViewModelLazy.getValue(ViewModelProvider.kt:54)
02-25 14:56:53.059 15106 15106 E AndroidRuntime: at androidx.lifecycle.ViewModelLazy.getValue(ViewModelProvider.kt:41)
02-25 14:56:53.059 15106 15106 E AndroidRuntime: at com.hisense.smartlab.link.tv.ui.LoginActivity.getMViewModel(LoginActivity.kt:25)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant