找不到 ID 为 'com.android.application' 的插件

Plugin with id 'com.android.application' not found

Error:(1, 0) Plugin with id 'com.android.application' not found i googled and searching since 3days but didn't get solution..... stuck totally ** i gradle version :2.5.. **build.gradle(projetc:android)

    // 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-experimental:0.2.1"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

build.gradle(模块:app)

    apply plugin: "com.android.model.application"

model {
    android {
        compileSdkVersion = 22
        buildToolsVersion = "22.0.1"

        defaultConfig.with {

            applicationId =  "com.example.altaf.Android"
            minSdkVersion.apiLevel = 15
            targetSdkVersion.apiLevel = 22
            versionCode = 1
            versionName = "1.0"


            buildConfigFields.with {
                create() {
                    type = "int"
                    name = "VALUE"
                    value = "1"
                }
            }

        }

    }

    android.buildTypes {
        release {
            minifyEnabled = false
            proguardFiles.add(file("proguard-rules.pro"))

        }
    }

    android.productFlavors {
        create("flavor1") {

            applicationId = "com.app"
        }
    }



    // Configures source set directory.

    android.sources {

        main {

            java {

                source {

                    srcDir "src"

                }

            }

        }

    }

}

dependencies {
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:22.2.0"
}

build.gradle(模块:opencvlibrary310)

 apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "19.1.0"

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 21
    }

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

更改应用插件:"com.android.application" 而不是应用插件:"com.android.model.application" in build.gradle(module:app)

像这样修改你的build.gradle(module:opencvlibrary310)

apply plugin: "com.android.model.application"

model {
    android {
        compileSdkVersion = 22
        buildToolsVersion = "22.0.1"

        defaultConfig.with {

            minSdkVersion.apiLevel = 15
            targetSdkVersion.apiLevel = 22

        }

    }
}

我正在使用以下版本的实验性 gradle 插件:

classpath 'com.android.tools.build:gradle-experimental:0.4.0'

更新:app 文件中删除以下行:

 android.sources {

        main {

            java {

                source {

                    srcDir "src"

                }

            }

        }

    }

希望对您有所帮助。