1
votes

Please, I have the error below and I can not identify the cause:

Error:(26, 0) Could not find method implementation() for arguments [com.google.firebase:firebase-core:16.0.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. Open File


FileNotFoundException: Entry fileTemplates//code/Google Test Fixture SetUp Method.cc.ft not found in /C:/Program%20Files/Android/Android%20Studio/lib/idea.jar

The google-services.json file is within the project, as documented:

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 (App):

enter image description here

enter code here

apply plugin: 'com.android.application'

android { compileSdkVersion 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'
    }
}

}

dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:24.2.1' implementation 'com.google.firebase:firebase-core:16.0.1' }

apply plugin: 'com.google.gms.google-services'

Print Screen Android:

enter image description here

1
Have you added apply plugin: 'com.google.gms.google-services' as the last line in your build.gradle file? - Alex Mamo

1 Answers

1
votes

Add google repository to your project and sync.

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