第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Gradle 同步失敗:com.google.android.gms:play-services

Gradle 同步失敗:com.google.android.gms:play-services

溫溫醬 2022-01-12 14:18:59
我正在嘗試將 firebase 包含在我的 android 項(xiàng)目中,如官方 firebase 文檔中所述。該應(yīng)用程序非常基礎(chǔ),使用 Google 的視覺 API。我得到的錯(cuò)誤:Gradle 同步失?。簾o(wú)法通知依賴解析偵聽器。[[11.0.4,11.0.4], [15.0.1,15.0.1]] 的各種其他庫(kù)正在請(qǐng)求庫(kù) com.google.android.gms:play-services-basement,但解析為 15.0。 1. 禁用插件并使用 ./gradlew :app:dependencies 檢查您的依賴關(guān)系樹。我已經(jīng)從網(wǎng)站上發(fā)布的類似問題中嘗試了一些對(duì)我不起作用的解決方案。更重要的是,我想了解根本原因,而不是盲目地修補(bǔ)版本。以下是我的 gradle 文件:模塊級(jí)apply plugin: 'com.android.application'/* ... */    dependencies {    implementation fileTree(include: ['*.jar'], dir: 'libs')    testImplementation 'junit:junit:4.12'    androidTestImplementation 'com.android.support.test:runner:2.0.2'    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'    implementation 'com.google.android.gms:play-services:11.0.4'    implementation 'com.google.firebase:firebase-core:16.0.1'}apply plugin: 'com.google.gms.google-services'項(xiàng)目級(jí)別// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {    repositories {        google()        jcenter()    }    dependencies {        classpath 'com.android.tools.build:gradle:3.2.1'        classpath 'com.google.gms:google-services:4.0.1'        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files    }}allprojects {    repositories {        google()        jcenter()    }}task clean(type: Delete) {    delete rootProject.buildDir}運(yùn)行./gradlew app:dependencies給出:無(wú)法通知依賴解析偵聽器。[[11.0.4,11.0.4], [15.0.1,15.0.1]] 的各種其他庫(kù)正在請(qǐng)求庫(kù) com.google.android.gms:play-services-basement,但解析為 15.0。 1. 禁用插件并使用 ./gradlew :app:dependencies 檢查您的依賴關(guān)系樹。[[11.0.4,11.0.4]] 的各種其他庫(kù)正在請(qǐng)求庫(kù) com.google.firebase:firebase-common,但解析為 16.0.0。禁用插件并使用 ./gradlew :app:dependencies 檢查您的依賴關(guān)系樹。
查看完整描述

1 回答

?
慕蓋茨4494581

TA貢獻(xiàn)1850條經(jīng)驗(yàn) 獲得超11個(gè)贊

更新以下內(nèi)容:

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

對(duì)此:

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

也如文檔中所述:

注意:不要使用組合play-services目標(biāo)。它引入了數(shù)十個(gè)庫(kù),使您的應(yīng)用程序膨脹。相反,只指定您的應(yīng)用使用的特定 Google Play 服務(wù) API。

因此,刪除此:

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

并添加具有更新版本的特定 google play 服務(wù) api,例如 implementation 'com.google.android.gms:play-services-auth:16.0.1'

還將 firebase-core 更新為版本 16.0.4

在這里查看更多信息:

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


當(dāng)您收到此錯(cuò)誤時(shí):

[[15.0.1,15.0.1]] 的各種其他庫(kù)正在請(qǐng)求庫(kù) com.google.android.gms:play-services-basement,但解析為 16.0.1。

這意味著您在 gradle 中使用的直接依賴項(xiàng)(在 google maven 存儲(chǔ)庫(kù)中)正在使用傳遞依賴項(xiàng)com.google.android.gms:play-services-basement。

在這種情況下,firebase-core:16.0.1使用play-services-basement:15.0.1最新版本的play-services-basementis 16.0.1,因此您會(huì)收到此錯(cuò)誤。

您還可以在 2018 年 10 月 2 日檢查這一點(diǎn),他們執(zhí)行了以下操作:

對(duì)其他使用的一些核心庫(kù)(play-services-auth、play-services-base、play-services-basement、play-services-flags、play-services-stats、play-services-tasks)進(jìn)行了較小的內(nèi)部功能更新Google Play 服務(wù)庫(kù)。

他們還發(fā)布了com.google.android.gms:play-services-basement:16.0.1com.google.firebase:firebase-core:16.0.4


查看完整回答
反對(duì) 回復(fù) 2022-01-12
  • 1 回答
  • 0 關(guān)注
  • 372 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)