java.lang.IllegalArgumentException: Service not registered

我们两清 提交于 2021-01-03 07:49:12

问题


I have a app which contains webview. Every thing is going well but in my run tab in android studio. I am getting below message. My app still working fine. But it still bugging me. I don't know much about this message.

Exception thrown while unbinding
    java.lang.IllegalArgumentException: Service not registered: lx@643d3c7
        at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1526)
        at android.app.ContextImpl.unbindService(ContextImpl.java:1717)
        at android.content.ContextWrapper.unbindService(ContextWrapper.java:722)
        at ci.b(:com.google.android.gms.dynamite_measurementdynamite@203615046@20.36.15 (040306-0):1)
        at ci.a(:com.google.android.gms.dynamite_measurementdynamite@203615046@20.36.15 (040306-0):6)
        at ly.A(:com.google.android.gms.dynamite_measurementdynamite@203615046@20.36.15 (040306-0):10)
        at li.a(:com.google.android.gms.dynamite_measurementdynamite@203615046@20.36.15 (040306-0):3)
        at ec.run(:com.google.android.gms.dynamite_measurementdynamite@203615046@20.36.15 (040306-0):3)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at jb.run(:com.google.android.gms.dynamite_measurementdynamite@203615046@20.36.15 (040306-0):6)

I searched google and come to know I have to declare service in manifest file.

Source https://stackoverflow.com/a/13600695/13485181

But I don't know which service I have to declare in manifest.

UPDATE

This Post is similar to mine

Android foreground service consistently throws "java.lang.IllegalArgumentException: Service not registered" exception

The Accepted answer is good

https://stackoverflow.com/a/62220764/13485181

I also use

 implementation 'com.google.android.gms:play-services-ads:19.3.0'

So I guess this dependency causing that message. But is there any way to remove that message although it's not effect the app.

Dependency

implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    implementation 'com.google.android.gms:play-services-ads:19.3.0'

来源:https://stackoverflow.com/questions/64059880/java-lang-illegalargumentexception-service-not-registered

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!