Any suggestions to fix this problem: I get this error in android studio after importing Project
Error: (16, 0) Gradle DSL method not found: 'android ()' Possible causes:
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.1.0' } } allprojects { repositories { jcenter() } } android { compileSdkVersion 21 buildToolsVersion '21.0.0' dexOptions { incremental true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 targetCompatibility JavaVersion.VERSION_1_6 } } dependencies { compile 'com.android.support:support-v4:21.0.3' compile 'com.android.support:appcompat-v7:21.0.3' } apply plugin: 'eclipse' apply plugin: 'java'
A notification bar appears that says: Gradle could not synchronize the project. A basic function (e.g. editing, debugging) will not work properly.
Please help me get rid of this problem. Thank!
android script, , , :
android
apply plugin: 'com.android.application'
apply plugin: 'com.android.library'
, script. -, script ( , " , ..." ), , , android , apply plugin . , android.
apply plugin
, apply plugin: 'java' script. Java, Android- script; .
apply plugin: 'java'
build.gradle
android { compileSdkVersion 21 buildToolsVersion '21.0.0' dexOptions { incremental true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 targetCompatibility JavaVersion.VERSION_1_6 } }
.
if you get an error, then check the version of the gradle file and remove the other gradle dependency as classpath 'com.android.tools.build:gradle:1.5.0'it might solve the problem
classpath 'com.android.tools.build:gradle:1.5.0'