Open QoutNPC opened 1 year ago
val viewModel: MarsViewModel = viewModel(factory = MarsViewModel.Factory)
is supposed to be inside the MarsPhotosApp.kt
file, just before the HomeScreen(marsUiState = viewModel.marsUiState)
. You can see this inside the main GitHub branch. The MarsPhotosApp()
function should have no input arguments.
Duplicate of #25, #20.
URL of codelab: https://developer.android.com/codelabs/basic-android-kotlin-compose-add-repository?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-5-pathway-2%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-add-repository#5
Specify the language of the codelab if it is not English: English
In which task and step of the codelab can this issue be found?
Add repository and Manual DI
[6. Add repository to ViewModel]
Describe the problem
There is no parameter of "viewModel" in Function "MarsPhotosApp" as all the operations done in this course.
So it cannot run successfully.
Steps to reproduce?
Versions Android Studio version:
Android Studio Dolphin | 2021.3.1 Patch 1 Build #AI-213.7172.25.2113.9123335, built on September 30, 2022 Runtime version: 11.0.13+0-b1751.21-8125866 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Linux 5.15.0-58-generic GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 4 Registry: external.system.auto.import.disabled=true ide.text.editor.with.preview.show.floating.toolbar=false ide.instant.shutdown=false
Current Desktop: ubuntu:GNOME
API version of the emulator:
Additional information Include screenshots if they would be useful in clarifying the problem.