错误:无法解析:com.google.firebase:firebase-crash:17.2.2

Neo*_*Neo 10 android firebase google-play-services android-studio

我正在尝试更新我的项目中的 google 和 firebase SDK 库以解决install_referrer 弃用的问题,但同步后出现错误

ERROR: Failed to resolve: com.google.firebase:firebase-crash:17.2.2
Run Code Online (Sandbox Code Playgroud)

合并清单上的此错误

ERROR: Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
    is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
    Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:28:5-422:19 to override.
Run Code Online (Sandbox Code Playgroud)

这是我的 firebase 和 google 依赖项

    implementation 'com.google.firebase:firebase-analytics:17.2.2'
    implementation 'com.google.firebase:firebase-crash:17.2.2'
    implementation 'com.google.firebase:firebase-config:19.1.1'
    implementation 'com.google.firebase:firebase-auth:19.2.0'
    implementation 'com.google.android.gms:play-services-auth:17.0.0'

    implementation 'com.google.android.gms:play-services-base:17.1.0'
    implementation 'com.google.android.gms:play-services-analytics:16.0.8'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'

    implementation 'com.google.firebase:firebase-core:17.2.2'
    implementation 'com.google.firebase:firebase-ads:18.3.0'
    implementation 'com.google.firebase:firebase-messaging:20.1.0'
Run Code Online (Sandbox Code Playgroud)

Pet*_*dad 19

使用以下依赖项:

implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta01'
Run Code Online (Sandbox Code Playgroud)

并更新您的应用程序以使用 AndroidX:

将 com.android.tools.build:gradle 升级到 v3.2.1 或更高版本。

将 compileSdkVersion 升级到 28 或更高版本。

更新您的应用以使用 Jetpack (AndroidX);按照迁移到 AndroidX 中的说明进行操作。

https://developer.android.com/jetpack/androidx/migrate


更新:

您现在可以使用以下依赖项版本:

dependencies {
    // Recommended: Add the Firebase SDK for Google Analytics.
    implementation 'com.google.firebase:firebase-analytics:17.5.0'

    // Add the Firebase Crashlytics SDK.
    implementation 'com.google.firebase:firebase-crashlytics:17.2.2'
}
Run Code Online (Sandbox Code Playgroud)

如果您在添加时遇到问题firebase-crashlytics,请查看以下文档:

https://firebase.google.com/docs/crashlytics/get-started?platform=android

https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=android


小智 7

尝试更改com.crashlytics.sdk.android:crashlytics:17.2.2com.google.firebase:firebase-crashlytics:17.2.1.

这对我有用。