与Firebase同步项目时出错

时间:2018-09-10 22:51:00

标签: android firebase

请,我有以下错误,我无法确定原因:

错误:(26,0)在类型org.gradle.api.internal.artifacts.dsl的对象上找不到参数[com.google.firebase:firebase-core:16.0.1]的方法Implementation()。 dependency.DefaultDependencyHandler。打开文件


FileNotFoundException:在/C:/Program%20Files/Android/Android%20Studio/lib/idea.jar

中找不到条目fileTemplates // code / Google测试治具设置Method.cc.ft

google-services.json文件位于项目中,如记录所示:

enter image description here

build.gradle(Projeto):

enter image description here

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.1.3'
    classpath 'com.google.gms:google-services:4.0.1'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}
  allprojects {
   repositories {
      jcenter()
   }
 }
 task clean(type: Delete) {
  delete rootProject.buildDir
 }

build.gradle(应用程序):

enter image description here

enter code here

应用插件:“ com.android.application”

android {     编译版本24     buildToolsVersion“ 28.0.2”

defaultConfig {
    applicationId "br.com.firebase.testes_firebase"
    minSdkVersion 24
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

依赖项{     编译fileTree(dir:'libs',包括:['* .jar'])     testCompile'junit:junit:4.12'     编译'com.android.support:appcompat-v7:24.2.1'     实施'com.google.firebase:firebase-core:16.0.1'   }

应用插件:“ com.google.gms.google-services”

Android打印屏幕:

enter image description here

1 个答案:

答案 0 :(得分:0)

将google存储库添加到您的项目中并进行同步。

allprojects { // ... repositories { // ... google() // Google's Maven repository } }