Issue
I am getting error: package android.arch.lifecycle does not exist and i tried to resolve it, i used below links : but none of these resolve it:
Failed to resolve: android.arch.lifecycle:extensions:1.0.0-alpha1 android studio 3.0 Could not resolve android.arch.lifecycle:extensions:1.1.0
i have below dependencies :
// Room components
implementation "android.arch.persistence.room:runtime:$rootProject.roomVersion"
annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion"
androidTestImplementation "android.arch.persistence.room:testing:$rootProject.roomVersion"
// Lifecycle components
implementation "android.arch.lifecycle:extensions:$rootProject.archLifecycleVersion"
annotationProcessor "android.arch.lifecycle:compiler:$rootProject.archLifecycleVersion"
Recently I got this link: https://developer.android.com/jetpack/androidx/releases/lifecycle#java which says : The APIs in lifecycle-extensions have been deprecated. Instead, add dependencies for the specific Lifecycle artifacts you need.
Does this mean now I need to use individual packages?
Solution
Finally i got the answer. android.support is deprecated , i migrated to androidx via following links:
https://medium.com/androiddevelopers/migrating-to-androidx-tip-tricks-and-guidance-88d5de238876 https://developer.android.com/jetpack/androidx/migrate
And at last if you get error like buttler knife/ (or any third party lib) not resolved, find android x compatible version i used:
// butter knife
implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
Answered By - rakesh kejriwal
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.