Migrating from Eclipse ... Error: (1, 0) Plugin with id 'com.android.application' not found

I migrated a project from eclipse to android studio and I am getting this error:

Error:(1, 0) Plugin with id 'com.android.application' not found.

      

I have gradle 2.2.1 and latest Android Studio version 1.0.2

My files:

APP MODULE:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.myapp"
        minSdkVersion 14
        targetSdkVersion 19
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
        compile 'com.google.android.gms:play-services-ads:6.5.87'
    }
}

      

PROJECT:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

      

gradle Shell Properties:

#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip

      

+3


source to share


1 answer


Working gradle build file.



buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.14.2'
    }
}
apply plugin: 'com.android.application'

repositories {
    jcenter()
}

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        minSdkVersion 9
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {   
    compile 'com.google.android.gms:play-services:6.5.87'

}

      

0


source







All Articles