我正在Kotlin中開發(fā)應(yīng)用程序,并不斷收到錯誤消息:無法解決:firebase-auth-15.0.0`嘗試同步gradle時。我正在嘗試實現(xiàn)Google登錄功能。apply plugin: 'com.android.application'apply plugin: 'kotlin-android'apply plugin: 'kotlin-android-extensions'apply plugin: 'com.google.gms.google-services'android {compileSdkVersion 28defaultConfig { applicationId "nus.is3261.kotlinapp" minSdkVersion 21 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"}buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' }}}dependencies {implementation fileTree(dir: 'libs', include: ['*.jar'])implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"implementation 'com.android.support:appcompat-v7:28.0.0'implementation 'com.android.support.constraint:constraint-layout:1.1.3'implementation 'com.android.support:support-v4:28.0.0'implementation 'com.android.support:design:28.0.0'testImplementation 'junit:junit:4.12'androidTestImplementation 'com.android.support.test:runner:1.0.2'androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'}我試圖在此處遵循堆棧溢出的解決方案,但是在同步gradle之后,我仍然收到此警告 Warning: The app gradle file must have a dependency on com.google.firebase:firebase-core for Firebase services to work as intended.
3 回答

慕的地6264312
TA貢獻(xiàn)1817條經(jīng)驗 獲得超6個贊
您收到以下錯誤:
無法解決:firebase-auth-15.0.0
因為您在代碼中使用了錯誤的依賴關(guān)系。要解決此問題,請更改以下代碼行:
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
至
implementation 'com.google.firebase:firebase-auth:16.0.5'
因為這樣的版本16.0.1:15.0.0不存在。
還請?zhí)砑右韵聫娭菩缘囊蕾図棧?/p>
implementation 'com.google.firebase:firebase-core:16.0.4'
現(xiàn)在,您的應(yīng)用程序gradle文件必須明確列出com.google.firebase:firebase-core作為Firebase服務(wù)正常工作的依賴項。
在頂層build.gradle文件中,請確保具有最新版本的Google服務(wù)插件:
classpath 'com.google.gms:google-services:4.1.0'
- 3 回答
- 0 關(guān)注
- 1132 瀏覽
添加回答
舉報
0/150
提交
取消