question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support AndroidX ViewModel

See original GitHub issue

Is your feature request related to a problem? Please describe. Google is changing the packaging to AndroidX, so, when we use Koin viewModel to do the injection it crashes with: Type parameter bound for T in inline fun <reified T : ViewModel> Context.viewModel(name: String = ..., noinline definition: Definition<T> /* = (ParameterProvider) -> T */): Unit is not satisfied: inferred type MyViewModel is not a subtype of ViewModel e: ...

Describe the solution you’d like Allow to use androidx.lifecycle.ViewModel

Describe alternatives you’ve considered hum… I don’t think there are not a lot of alternatives

Target Koin project android

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

10reactions
arnaudgiulianicommented, May 11, 2018

Hello,

AndroidX is in alpha-1. Let’s keep it under the hand and upgrade it when it will be in a more stable state (else we will have to regularly provide updates).

9reactions
arnaudgiulianicommented, May 25, 2018

koin-androidx is available in jcenter 👍

implementation "org.koin:koin-androidx:1.0.0-alpha-11"
Read more comments on GitHub >

github_iconTop Results From Across the Web

ViewModel overview - Android Developers
ViewModel lets you manage your UI's data in a lifecycle-aware fashion.
Read more >
ViewModels : A Simple Example. Introduction | by Lyla Fujiwara
The ViewModel class is designed to hold and manage UI-related data in a life-cycle conscious way. · ViewModels separate UI implementation from your...
Read more >
ViewModel.java - Google Git
ViewModel is a class that is responsible for preparing and managing the data for ... Activity Activity} or a {@link androidx.fragment.app.
Read more >
ViewModel in Android Architecture Components
ViewModel is one of the most critical class of the Android Jetpack Architecture Component that support data for UI components.
Read more >
how to instantiate ViewModel In AndroidX? - Stack Overflow
For Pre-AndroidX use implementation "android.arch.lifecycle:viewmodel:1.1.1" (1.1.1 is the last version from this artifact i guess.) In ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found