Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Android Kotlin Fundamentals codelab: Lesson 5.1 uses deprecated class #166

Closed
devShaurya opened this issue May 18, 2020 · 1 comment
Closed
Labels
duplicate This issue or pull request already exists

Comments

@devShaurya
Copy link

devShaurya commented May 18, 2020

The problem
The kotlin code for viewmodel has not been updated. It still uses ViewModelProviders.of() which has been deprecated.

In which lesson and step of the codelab can this issue be found?
in Android Kotlin Fundamentals 05.1: ViewModel and ViewModelFactory, Step 4.

How to reproduce?
if you follow the instructions in the codelab then you can reproduce it.

Versions

  1. What version of Android Studio are you using? Ans 3.6.3
  2. What API level are you targeting? Ans 28

Additional information
It can be corrected by using ViewModelProvider(this).get(GameViewModel::class.java and adding kotlinOptions{ jvmTarget="1.8"} to build.gradle(project level)
codelab: android-kotlin-fundamentals

@devShaurya devShaurya changed the title Android Kotlin Fundamentals codelab: Android Kotlin Fundamentals codelab: Lesson 5.1 uses deprecated class May 18, 2020
@GeneAndGoogle GeneAndGoogle added the duplicate This issue or pull request already exists label Jun 10, 2020
@GeneAndGoogle
Copy link
Contributor

Duplicate of #29

@GeneAndGoogle GeneAndGoogle marked this as a duplicate of #29 Jun 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants