首頁 > Java > java教程 > 主體

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

Susan Sarandon
發布: 2024-11-15 13:40:02
原創
308 人瀏覽過

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中文網其他相關文章!

來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
作者最新文章
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板