首頁  >  文章  >  Java  >  如何解決 Android FirebaseUI 中的「無法解析 com.google.android.gms Play-Services-Auth:11.4.0」錯誤?

如何解決 Android FirebaseUI 中的「無法解析 com.google.android.gms Play-Services-Auth:11.4.0」錯誤?

Susan Sarandon
Susan Sarandon原創
2024-11-15 13:40:02309瀏覽

How to Resolve \

Resolving "Failed to Resolve Com.google.android.gms Play-Services-Auth:11.4.0" Error

Issue Description

When attempting to write code for Android FirebaseUI - Auth, users may encounter an error "Failed to resolve com.google.android.gms play-services-auth:11.4.0." This error typically arises due to discrepancies in repository configuration or version mismatches.

Solution

To resolve this issue, follow these steps:

1. Add Google Maven Repository to Root-Level build.gradle

Add the following repository to your root-level build.gradle file:

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

Starting from 11.2.0, this maven repository is required.

2. Ensure Consistent Library Versions

Verify that all Firebase and Google Play Services libraries use the same version. In this case, you should use the following versions:

compile 'com.google.firebase:firebase-database:11.0.4'
compile 'com.google.firebase:firebase-auth:11.0.4'
compile 'com.google.android.gms:play-services-auth:11.4.0'

3. Update Google Play Services Plugin

Upgrade the Google Play Services plugin in your build.gradle file to the latest version (at least 3.3.1):

classpath 'com.google.gms:google-services:4.0.1'

4. Update Libraries to Latest Versions

Update all Firebase and Google Play Services libraries to their latest versions as well.

Note: As of May 2023, Firebase Android SDKs and Google Play Services libraries have independent version numbers.

以上是如何解決 Android FirebaseUI 中的「無法解析 com.google.android.gms Play-Services-Auth:11.4.0」錯誤?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn