这个问题在这里已有答案:
我的build.gradle
文件如下:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.my.prohead"
minSdkVersion 24
targetSdkVersion 26
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:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
//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-core:16.0.6'
//implementation 'com.google.firebase:firebase-auth:11.0.4'
// implementation 'com.google.firebase:firebase-database:16.0.5'
//implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
}
apply plugin: 'com.google.gms.google-services'
但它没有被编译,虽然如果我尝试更改实现它已经设置依赖关系未设置依赖性! 任何帮助将不胜感激!
从您的应用级别build.gradle
文件中删除此内容:
implementation 'com.google.firebase:firebase-auth:16.1.0:15.0.0'
并仅添加此项
implementation 'com.google.firebase:firebase-auth:16.1.0'
应该:
implementation 'com.google.firebase:firebase-auth:16.0.1' //delete 15.0.0
在项目级别构建gradle文件:
allprojects {
repositories {
google() //add this line
jcenter()
// ...
}
}