android studio - Error: Gradle DSL method not found: 'compile()' -


possible causes:

  • the project (project_name) may using version of gradle not contain method.

  • the build file may missing gradle plugin.

i imported android studio project android studio , getting lot of errors. new android studio , getting error in android studio , unable find solution problem. there no build.gradle(module-app) in project.

here build.gradle (project:project_name-app) code:

// top-level build file can add configuration options common sub-projects/modules. buildscript {   repositories {       jcenter()       mavencentral()   }    dependencies {       classpath 'com.android.tools.build:gradle:2.1.2'        // note: not place application dependencies here; belong       // in individual module build.gradle files   } }  allprojects {   repositories {       jcenter()       mavencentral()   } }  task clean(type: delete) {   delete rootproject.builddir }  dependencies {   // https://mvnrepository.com/artifact/com.android.tools/sdklib   compile group: 'com.android.tools', name: 'sdklib', version: '25.1.2'   compile 'com.android.support:support-annotations:23.1.1'   compile 'com.android.support:support-v4:23.1.1'   compile 'com.android.support:appcompat-v7:23.1.1'   compile 'com.android.support:support-v13:23.1.1'   compile 'com.android.support:cardview-v7:23.1.1'   compile project(':app')   compile 'com.android.support:design:23.1.1'   compile 'com.android.support:gridlayout-v7:23.1.1' }  android {   compilesdkversion 23   buildtoolsversion '23.0.1'   dexoptions {     incremental true   }    compileoptions {     sourcecompatibility javaversion.version_1_6     targetcompatibility javaversion.version_1_6   } }  repositories {   maven { url 'android.support.design.widget.appbarlayout' } } 

please !!!


Comments