导入android studio 项目错误:Error:(1, 0) Plugin with id 'com.android.application' not found

导入android studio项目后遇到 


build.gradle文件内容是:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 14
    buildToolsVersion '25.0.3'
    defaultConfig {
        applicationId "cn.test.videowindows"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:25.0.3'
}
只需要添加上 


buildscript {
    repositories {
//        mavenCentral() // or
    jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2'   //last version Jan 2016
    }
}


修改完后为:


apply plugin: 'com.android.application'

android {
    compileSdkVersion 14
    buildToolsVersion '25.0.3'
    defaultConfig {
        applicationId "cn.test.videowindows"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

buildscript {
    repositories {
//        mavenCentral() // or
    jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2'   //last version Jan 2016
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:25.0.3'
}


你可能感兴趣的:(android,studio)