android - com.google.android.gms.common.internal.zzf 类型被引用为 > 接口(interface)

标签 android firebase android-studio

我将我的 android 应用程序迁移到 AndroidX(从菜单 Refactor-> 迁移到 androidX),现在当我运行应用程序时它工作正常,但是当我尝试生成签名的 .apk 文件时,我收到一个错误,例如


Type com.google.android.gms.common.internal.zzf is referenced as an interface from com.google.android.gms.internal.zzcdb.

Type com.google.android.gms.common.internal.zzf is referenced as an interface from com.google.android.gms.internal.zzii.

Type com.google.android.gms.common.internal.zzf is referenced as an interface from com.google.android.gms.internal.zzcms.


enter image description here

这是我在应用程序中使用的依赖项列表,
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:29.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation('com.android.support:support-annotations:29.0.0')
    implementation "com.android.support:design:29.0.0"
    implementation 'com.android.support:support-v4:29.0.0'
    implementation "com.google.android.material:material:1.0.0"
    implementation 'com.google.android:flexbox:0.3.2'

    implementation 'com.android.support:multidex:1.0.3'

    implementation 'me.relex:circleindicator:1.2.2@aar' //For view pager circle

    implementation 'com.jakewharton:butterknife:10.2.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.0'

    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.github.ybq:Android-SpinKit:1.1.0'

    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'com.squareup.okhttp3:okhttp:4.2.2'
    implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
    implementation('com.squareup.retrofit2:retrofit:2.6.2') {
        exclude module: 'okhttp'
    }

    implementation project(":photoview")

    implementation 'com.google.android.gms:play-services:12.0.1'
    implementation 'com.google.firebase:firebase-messaging:20.0.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'

    implementation 'com.google.android:flexbox:0.3.2'
    implementation('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') {
        transitive = true;
    }

}

最佳答案

这可能是您的问题的原因:

implementation 'com.google.android.gms:play-services:12.0.1'

其实这个依赖是非常过时了。实际上,您应该将其完全删除,然后让 firebase-messaging 只接收它需要的内容。

如果您需要使用任何特定的播放服务库,您应该使用此处列出的新的、更细化的库之一:

https://developers.google.com/android/guides/releases

关于android - com.google.android.gms.common.internal.zzf 类型被引用为 > 接口(interface),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58693575/

相关文章:

android - onLocationChanged 只调用一次,不刷新

java - Activity 之外的类中的变量

java - 如何从 firebase 实时数据库检索两个不同的值并使用外部 onDataChange 方法?

android - 如何设置对话框外边距? (安卓)

android - 生成签名APK播放商店

android - 推送通知不适用于 FCM

firebase - 如何在 firebase 中仅对电子邮件/密码帐户进行短信验证?

firebase - 如何在 flutter 的轮播 slider 中从firebase中删除图像之间的加载时间

android-studio - gradle项目同步失败的Android Studio 3.1.2

Android Studio 在可绘制属性处显示红色感叹号