Skip to content

TangleViewModelFactory is incompatible with ViewModelProvider.Factory binary change in lifecycle-viewmodel 2.4.0 #377

@RBusarow

Description

@RBusarow

https://developer.android.com/jetpack/androidx/releases/lifecycle#2.4.0-alpha03

API Changes

Source-breaking change: ViewModelProvider has been rewritten in Kotlin. ViewModelProvider.Factory.create method now longer allows nullable generic. (I9b9f6)

Basically, this:

override fun <T : ViewModel?> create(modelClass: Class<T>): T

becomes this:

override fun <T : ViewModel> create(modelClass: Class<T>): T

Since the old nullability was just automatically added by the IDE and not actually enforced by the compiler, a new version which is non-nullable is still binary-compatible with projects using lifecycle-viewmodel:2.3.1 or earlier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions