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