java.lang.RuntimeException: Cannot create an instance of class viewmodel.LoginViewModel
i have encountered this issue.
i am using jetpack compose with android hilt in my current android project.
Application crashes as soon as the activity appears in the screen.
After viewing many solution, many suggested to make
how to pass custom args in hilt viewModel android
Screen(AppScreens.InfoScreen.route) { navBackStackEntry -> val viewModel = hiltViewModel<ProfileDisplayScreenViewModel>() val uiState by viewModel.uiState.collectAsState() LaunchedEffect(Unit) { viewModel.setUpId(navBackStackEntry.getInt()!!) } ProfileDisplayScreen(uiState, viewModel.interActor) } i don’t want to use LaunchedEffect and i want to pass args directly is this possible ? if yes then how ? android viewmodel dagger-hilt
com.example.foodymaster2.MyApplication cannot be provided without an @Inject constructor or an @Provides-annotated method
I was making an android app then this comes find out that it comes from hilt.