Java FireBase与Android Studio同步失败
我尝试实现一个应用程序,将您的详细信息放入Firebase的数据库中 我从网站同步代码 Android Studio版本:3.0.1 代码来自 build.gradle:Java FireBase与Android Studio同步失败,java,android,android-studio,firebase,Java,Android,Android Studio,Firebase,我尝试实现一个应用程序,将您的详细信息放入Firebase的数据库中 我从网站同步代码 Android Studio版本:3.0.1 代码来自 build.gradle: // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { dependencies { classpath 'com.android
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
//you need to add this line
classpath 'com.google.gms:google-services:3.2.0' // google-services plugin
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
应用程序中的build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.eranp.clientpage"
minSdkVersion 19
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(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation files('libs/activation.jar')
implementation files('libs/additionnal.jar')
implementation files('libs/mail.jar')
compile 'com.google.firebase:firebase-auth:11.8.0'
}
apply plugin: 'com.google.gms.google-services'
错误输出:
Error:Could not find com.google.gms:google-services:3.2.0. Searched
in the following locations:
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/3.2.0/google-services-3.2.0.pom
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/3.2.0/google-services-3.2.0.jar
Required by:
project :
我需要做些什么来解决这个问题?首先删除应用插件后的}符号。它不需要牙套。然后trydependencies{implementation fileTree(dir:'libs',include:['*.jar'])实现'com.android.support.constraint:constraint布局:1.0.2'implementation'com.google.firebase:firebase auth:11.8.0'testImplementation'junit:junit:4.12'androidTestImplementation'com.android.support.test:runner:1.0.1'androidTestImplementation('com.android.support.test.espresso:espresso core:3.0.1')){exclude group:'com.android.support',module:'support annotations'}}apply plugin:'com.google.gms.google-services'我完全无法重现此错误。是否有未显示的内容?请尝试一个新的、新的项目。这是一个新项目显示您的完全依赖关系