Failed to resolve: androidx.lifecycle:lifecycle-extensions-ktx:2.0.0-alpha1

UPDATE

As per @Dr.jacky's comment and Android Developers Documentation,

The APIs in lifecycle-extensions have been deprecated. Instead, add dependencies for the specific Lifecycle artifacts you need.

More Info at https://developer.android.com/jetpack/androidx/releases/lifecycle


I have found the answer. As Thunder Knight said here it seems to be that the repository was emptied somehow. Hence, you can not download it from the repository.. I agree with this and so i was looking for answer on mvnrepository.com and i found it here. I have to add

implementation group: 'androidx.lifecycle', name: 'lifecycle-extensions', version: '2.0.0-alpha1'

line for adding lifecycle-extensions and also i was adding -ktx in name of library but it was the mistake. In documentation they have not commented to add -ktx in line of lifecycle-extensions.

Credits:- @Thunder Knight


The current version is 2.2.0

use -ktx for kotlin implementation and kapt for annotationProcesssor

implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.2.0'

Check the developer site for more information

https://developer.android.com/topic/libraries/architecture/adding-components


Just dont use -ktx in lifecycle-extensions. There is no separate '-ktx' version of the dependency unlike in viewmodel