Issue
I am trying to extend LifecycleService
. I have implemented the following in build.gradle
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0"
The below line gives error:
internal class MyService: LifecycleService() {
Unresolved reference: LifecycleService
What am I doing wrong here?
Solution
As per the Lifecycle Declaring dependencies, you need to use lifecycle-service
to use LifecycleService
:
implementation "androidx.lifecycle:lifecycle-service:2.2.0"
(This would in addition to lifecycle-runtime-ktx
)
Answered By - ianhanniballake
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.