问题
Hello fellow developer i'm new to Android Development I just want to know how to resolve this kind of problem because i need to connect my app to firebase.
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.acemergencyapp.user.aceapp"
minSdkVersion 14
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 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.3'
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'
}
I have a red line in implementation 'com.android.support:appcompat-v7:28.0.0'
回答1:
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
Remove this dependency (last line)
You have already included version 16.0.3 above
回答2:
you have two version numbers there... obviously a copy & paste fail.
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
probably should rather be (which is already contained a few lines above):
implementation 'com.google.firebase:firebase-auth:16.0.3'
... maybe read your build.gradle
, before posting your typos here.
回答3:
Solution:
Navigate to SDK Manager
-> SDK Tools
.
First, click the Android SDK Build-Tools
and install the latest update.
Second, click the Android SDK Platform-Tools
and install the latest update.
This should fix the red line.
(Alternatively suppose if it does not go try the below code)
Write this:
implementation 'com.android.support:support-v4:28.0.0'
or this:
implementation 'com.android.support:design:28.0.0'
Hope it helps.
来源:https://stackoverflow.com/questions/52504927/failed-to-resolve-firebase-auth-15-0-0