为什么我会收到“服务未注册"的消息?例外,即使我没有在Android中使用任何服务-Java/Kotlin? [英] Why does I'm getting "Service not registered" exception, even though I not used any service in Android - Java/Kotlin?

查看:96
本文介绍了为什么我会收到“服务未注册"的消息?例外,即使我没有在Android中使用任何服务-Java/Kotlin?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有使用任何接收器或其他东西.但是我在Android项目中使用了Firebase.以前我没有收到此异常,但是突然出现了!

I haven't used any receiver or something. But I used Firebase in my Android project. Previously I was not getting this exception, but suddenly it is showing!

例外:

W: Exception thrown while unbinding
    java.lang.IllegalArgumentException: Service not registered: com.google.android.gms.measurement.internal.zzjp@4701ac1
        at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1751)
        at android.app.ContextImpl.unbindService(ContextImpl.java:1776)
        at android.content.ContextWrapper.unbindService(ContextWrapper.java:741)
        at com.google.android.gms.common.stats.ConnectionTracker.zza(com.google.android.gms:play-services-basement@@17.3.0:55)
        at com.google.android.gms.common.stats.ConnectionTracker.unbindService(com.google.android.gms:play-services-basement@@17.3.0:50)
        at com.google.android.gms.measurement.internal.zziv.zzag(com.google.android.gms:play-services-measurement-impl@@17.5.0:245)
        at com.google.android.gms.measurement.internal.zziv.zzal(com.google.android.gms:play-services-measurement-impl@@17.5.0:262)
        at com.google.android.gms.measurement.internal.zziv.zzc(com.google.android.gms:play-services-measurement-impl@@17.5.0:336)
        at com.google.android.gms.measurement.internal.zziu.zza(com.google.android.gms:play-services-measurement-impl@@17.5.0:2)
        at com.google.android.gms.measurement.internal.zzai.run(com.google.android.gms:play-services-measurement-impl@@17.5.0:7)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at com.google.android.gms.measurement.internal.zzfy.run(com.google.android.gms:play-services-measurement-impl@@17.5.0:21)

清单文件中没有重要内容.

There is nothing important in Manifest file.

Buld.gradle(应用程序):

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0-rc03'
        classpath 'com.google.gms:google-services:4.3.4'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Build.gradle(模块)

dependencies {
    ......

//Google Firebase
    implementation 'com.google.firebase:firebase-auth:19.4.0'
    implementation 'com.google.firebase:firebase-database:19.5.0'
    implementation 'com.google.firebase:firebase-messaging:20.3.0'
    implementation 'com.google.firebase:firebase-storage:19.2.0'
    implementation 'com.google.firebase:firebase-crashlytics:17.2.2'
    implementation 'com.google.android.gms:play-services-analytics:17.0.0'
    implementation 'com.google.firebase:firebase-analytics:17.5.0'
 //Google Location
    implementation 'com.google.android.gms:play-services-location:17.1.0'

    //Shimmer Layout
    implementation 'com.facebook.shimmer:shimmer:0.5.0'

    //Google Auth
    implementation 'com.google.android.gms:play-services-auth:18.1.0'
    implementation 'com.google.android.gms:play-services-auth-api-phone:17.4.0'

BaseApplication

public class BaseApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
        FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(true);
    }

    protected void showLog(String msg) {
        Log.d(this.getClass().getSimpleName(), msg);
    }

}

故障排除:

  1. 发现了此内容: https://developers .google.com/android/reference/com/google/android/gms/measurement/package-summary
  2. 搜索了stackoverflow,但未找到正确的解决方案
  3. 已检查的清单文件
  4. 在进行测试时,Firebase服务运行良好
  5. 不明白,该在哪里调试!
  1. Found this: https://developers.google.com/android/reference/com/google/android/gms/measurement/package-summary
  2. Searched on stackoverflow, but not found proper solution
  3. Checked Manifest file
  4. While testing, Firebase services are running fine
  5. Not understood, what to debug where!

谢谢!

推荐答案

此答案的最新更新时间是: -2021年2月12日

This answer is last updated on: 12-Feb-2021

我们不需要采取任何行动.请稍候,Google将在何时发布此已修复"的"

正如许多人指出的那样,事实证明存在一些 即使发生以下情况也会触发警告的设备配置 我上面提供的解决方法.

As many of you have pointed out, it turns out that there exist some device configurations that trigger the warning even with the workaround I provided above.

不幸的是,我们无法做更多的事情来沉默".警告 在SDK方面.该警告是由"Google Play服务"引起的. 本身.好消息是,问题的根本原因是现在 固定,但是它将在2月左右推出到设备上,因此我们将 必须忍受这个警告几个月.

Unfortunately there is nothing more we can do to "silence" the warning on the SDK side. The warning is caused by "Google Play Services" itself. The good news is that the root cause of the issue is now fixed, however it will roll out to devices around February, so we will have to live with this warning for a few months.

我知道这给开发人员带来了不便,但是 这是警告而不是崩溃.所以请耐心等待直到更新 推出.谢谢

I understand that it is causing inconvenience for developers, but fwiw it's a warning not a crash. So please bear with us till the update gets rolled out. Thanks

PS:你们中许多人评论说有时会出现此警告 崩溃(有其自身的例外),我相当有信心 在这种情况下,崩溃与该警告完全无关,仅此而已 恰好发生在它之后.所以请调查您的崩溃 独立地,只是忽略警告.但是,如果您认为 崩溃是相关的,请提供:

PS: Many of you have commented that this warning is sometimes followed by a crash(with its own exception), I am fairly confident that in most cases, the crash is completely unrelated to this warning and just so happens to occur right after it. So please investigate your crashes independently, just ignoring the warning. If however you think that the crash is related, please provide:

在与您的崩溃相关的依赖项下发生完整堆栈跟踪 应用程序理想的步骤是重现再次转发此答复,因此更多 对人们可见.

full stack traces at the event of crash relevant dependencies of your app ideally steps to reproduce Bumping this reply again, so it's more visible for folks.

再次:警告是良性的,可以忽略.该修复程序将 在2021年2月左右推出,无需对开发者的产品采取任何措施 方面,此修复程序将适用于Google Play服务本身和现有的服务 应用程序将停止生成警告.

Once again: The warning is benign and is safe to ignore. The fix will get rolled out around Feb 2021, no action is required on developers' side, the fix will apply to google play services itself and existing apps will stop generating the warning.

来源: https://github.com/firebase /firebase-android-sdk/issues/1662#issuecomment-756917362

这篇关于为什么我会收到“服务未注册"的消息?例外,即使我没有在Android中使用任何服务-Java/Kotlin?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆