Error: (1, 0) Gradle DSL method not found: 'apply ()'

0

I have an error I never had in when compiling in Android Studio.

  

Error: (1, 0) Gradle DSL method not found: 'apply ()' Possible causes:

     
  • The project 'Mas104.5' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file
  •   
  • The build file may be missing to Gradle plugin. Apply Gradle plugin
  •   

\ build.gradle

buildscript {
    repositories {
    jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

\ app \ build.gradle

apply plugin: 'com.android.application'

android  {
    compileSdkVersion 23
    buildToolsVersion '25.1.7'
    defaultConfig {
        applicationId "masproducciones.radiomas1045"
        minSdkVersion 5
        targetSdkVersion 23
        versionCode 2
        versionName "1.0.1"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dataBinding {
        enabled = true
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:23.4.0'
    compile 'com.google.android.gms:play-services-appindexing:8.1.0'
}
    
asked by Federico Rocha 27.07.2016 в 13:54
source

1 answer

1

Reviewing your configuration it seems to me that your problem is the following:

  

The build file may be missing to Gradle plugin. Apply Gradle plugin

Check that all the dependencies are only in the build.gradle that is at the application level and ensure that they are found in your project:

\app\build.gradle
    
answered by 27.07.2016 в 14:13