android上的firebase:身份验证和数据库,带错误的gradle同步
我已经编写了一个使用Firebase数据库功能的Android应用程序。一切正常,现在我想集成身份验证功能。因此,我修改了应用程序的build.gradle,使其包含两个身份验证依赖项:android上的firebase:身份验证和数据库,带错误的gradle同步,android,firebase,firebase-realtime-database,firebase-authentication,Android,Firebase,Firebase Realtime Database,Firebase Authentication,我已经编写了一个使用Firebase数据库功能的Android应用程序。一切正常,现在我想集成身份验证功能。因此,我修改了应用程序的build.gradle,使其包含两个身份验证依赖项: apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "com.ex
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.gmeunier.gestiondepoints"
minSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.google.android.gms:play-services-plus:10.2.6'
compile 'com.google.firebase:firebase-database:10.2.6'
compile 'com.firebaseui:firebase-ui-auth:1.2.0'
compile 'com.google.firebase:firebase-auth:10.2.6'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
尽管我在这方面做了很多努力和研究,但在尝试同步此渐变时仍存在以下错误:
未能解析:com.twitter.sdk.android:twitter:2.3.0
我找不到我必须使用的lib/component版本,我非常感谢您的帮助和支持。您的项目的gradle文件应该是这样的
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
// Required for 'com.firebaseui:firebase-ui:1.1.1'
maven {
url 'https://maven.fabric.io/public'
}
}
}
原始答案:项目的gradle文件应该如下所示
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
// Required for 'com.firebaseui:firebase-ui:1.1.1'
maven {
url 'https://maven.fabric.io/public'
}
}
}
原始答案:将“存储库”、“所有项目”和“构建脚本”中的以下行添加到项目级build.gradle文件中:
maven {
url 'https://maven.fabric.io/public'
}
在“repositories”、“allprojects”和“buildscript”中向项目级build.gradle文件添加以下行:
maven {
url 'https://maven.fabric.io/public'
}
它起作用了!谢谢。我真的不明白为什么我现在需要这个maven的东西,而不是以前(即当我的应用程序中只使用了数据库功能时)它可以工作!谢谢。我真的不明白为什么我现在需要这个maven的东西,而不是以前(即当我的应用程序中只使用了数据库功能时)