【问题标题】:com.xxx.xxx W/ConnectionTracker: Exception thrown while unbindingcom.xxx.xxx W/ConnectionTracker:解除绑定时抛出异常
【发布时间】:2021-03-17 11:55:01
【问题描述】:

我正在尝试通过单击按钮加载插页式广告。不幸的是,得到了这个。

java.lang.IllegalArgumentException:服务未注册:com.google.android.gms.measurement.internal.zzjl@f5ae32b 在 android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1757)

app build.gradle

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation platform('com.google.firebase:firebase-bom:26.1.0')
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-analytics'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.2.0'
implementation 'com.google.firebase:firebase-core:18.0.0'
implementation 'io.github.kobakei:ratethisapp:1.2.0'
implementation 'com.google.android.gms:play-services-ads:19.6.0'
implementation 'com.google.firebase:firebase-perf'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.drawerlayout:drawerlayout:1.1.1'
implementation 'com.github.hotchemi:android-rate:1.0.1'

项目 build.gradle

    classpath 'com.android.tools.build:gradle:4.1.1'
    classpath 'com.google.gms:google-services:4.3.4'
    classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
    classpath 'com.google.firebase:perf-plugin:1.3.4'

【问题讨论】:

    标签: android firebase google-play-services


    【解决方案1】:

    如果您要使用 Firebase BoM,您应该将其设置为所有 Firebase 依赖项的版本。你不会让它成为这个版本:

    implementation 'com.google.firebase:firebase-core:18.0.0'
    

    事实上,您根本不需要 firebase-core。根据documentation

    不再需要 Firebase Android 库 firebase-core。此 SDK 包括适用于 Google Analytics 的 Firebase SDK。

    因此,如果您不直接使用它,只需完全删除依赖项即可。或者至少删除版本号。

    【讨论】:

      【解决方案2】:

      如果您不使用分析,请尝试删除此行:

      implementation 'com.google.firebase:firebase-analytics'
      

      【讨论】:

        猜你喜欢
        • 2021-02-07
        • 1970-01-01
        • 2013-05-24
        • 1970-01-01
        • 2022-06-16
        • 1970-01-01
        • 2021-02-25
        • 2020-11-20
        • 2011-05-30
        相关资源
        最近更新 更多