0

I get an error after I import my project from eclipse. Not a problem in my code but I'm having trouble with build.gradle. How can I fix it?

build.gradle code here:

apply plugin: 'java'
sourceSets {
main.java.srcDirs = ['src']
main.resources.srcDirs = ['src']
test.java.srcDirs = ['tests/java']
test.resources.srcDirs = ['tests/resources']
}

android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
dexOptions {
    incremental true
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_6
    targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
}ode here
  • If this is the `build.gradle` file for an Android application the first line should be `apply plugin: 'com.android.application'` – George Mulligan Apr 09 '16 at 23:33
  • after i added 'com.android.application' it now says plugin with id 'com.android.application' not found –  Apr 09 '16 at 23:41
  • See if this [related question](http://stackoverflow.com/q/24795079/1435985) helps in that case. Might be an older version of Gradle or one of the other dependencies. Are you using the new version of Android Studio 2.0 that was just released? – George Mulligan Apr 09 '16 at 23:44
  • It's working now thanks George –  Apr 10 '16 at 15:08

0 Answers0