gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 17:46:25 26 4
gpt4 key购买 nike

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(module: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(module: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'
}
}
}

最佳答案

像这样修改您的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"

}

}

}

}

希望对您有所帮助。

关于android - 找不到ID为 'com.android.application'的插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34490483/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com