It seems the LifecycleService class that used to live in the lifecycle-extensions
artifact is not available in any of the current recommended artifacts. I'd expect it to be in lifecycle-runtime
, which is the one without ViewModel andLiveData, but LifecycleService
is not in lifecycle-viewmodel
or lifecycle-livedata
.
Has LifecycleService been deprecated?
No, LifecycleService
is in the lifecycle-service
dependency as per the Lifecycle 2.2.0 release notes:
lifecycle-extensions
Artifact Deprecation: With the above deprecation ofViewModelProviders.of()
, this release marks the deprecation of the last API inlifecycle-extensions
and this artifact should now be considered deprecated in its entirety. We strongly recommend depending on the specific Lifecycle artifacts you need (such aslifecycle-service
if you’re usingLifecycleService
andlifecycle-process
if you’re usingProcessLifecycleOwner
) rather than lifecycle-extensions as there will not be a future2.3.0
release oflifecycle-extensions
.