In which task and step of the codelab can this issue be found?
StartFragment.kt
Describe the problem
private val sharedViewModel: OrderViewModel by activityViewModels()
After inserting this line of code into each fragment as instructed, Android Studio does not recognize the activityViewModels() even after import. The error message reads:
Type mismatch: inferred type is ViewModel but OrderViewModel was expected
Steps to reproduce?
Go to...
Click on...
See error...
VersionsAndroid Studio version: arctic fox 2020.3.1 Patch 3
API version of the emulator: 28
Additional informationInclude screenshots if they would be useful in clarifying the problem.
URL of codelab https://github.com/google-developer-training/android-basics-kotlin-cupcake-app.git
In which task and step of the codelab can this issue be found? StartFragment.kt
Describe the problem private val sharedViewModel: OrderViewModel by activityViewModels() After inserting this line of code into each fragment as instructed, Android Studio does not recognize the activityViewModels() even after import. The error message reads:
Type mismatch: inferred type is ViewModel but OrderViewModel was expected
Steps to reproduce?
Versions Android Studio version: arctic fox 2020.3.1 Patch 3 API version of the emulator: 28
Additional information Include screenshots if they would be useful in clarifying the problem.