简体   繁体   English

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

[英]Plugin with id 'com.android.application' not found

I have an old project, I import this project in my Android studio, i am getting this error. 我有一个旧项目,我在Android Studio中导入了该项目,但出现此错误。 Yes I searched for it from internet and i found many solutions for that,but non of them solved my issue. 是的,我从互联网上进行搜索,发现了很多解决方案,但是没有一个解决了我的问题。

Here is my build.gradle file 这是我的build.gradle文件

// Top-level build file where you can add configuration options common to all sub-projects/modules.


buildscript {
repositories {
    jcenter()
}
apply plugin: 'com.android.application'

dependencies {
    classpath 'com.android.tools.build:gradle:2.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
}

Here is My module level build.gradle here is my build.gradle which is under app>src>build.gradle 这是我的模块级别build.gradle这是我的build.gradle在app> src> build.gradle下

apply plugin: 'com.android.application'
//apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
    applicationId "com.pedrocarrillo.expensetracker"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 3
    versionName "1.2"
}

signingConfigs {
    release {
        def Properties localProps = new Properties()
        localProps.load(new FileInputStream(file('../local.properties')))
        storeFile file("tracker_expense.jks")
        storePassword localProps["storePass"]
        keyAlias localProps["alias"]
        keyPassword localProps["pass"]
    }
}

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

repositories {
maven { url "https://jitpack.io" }
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
//    compile 'com.google.android.gms:play-services:7.8.0'
compile 'com.android.support:gridlayout-v7:23.0.1'
compile 'com.android.support:support-annotations:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
compile 'io.realm:realm-android:0.82.2'
compile 'com.github.PhilJay:MPAndroidChart:v2.1.4'
}

Try This : Project Level Gradle File ... 试试看: 项目级Gradle文件 ...

// 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:2.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
}

Module Level Gradle File ... 模块级Gradle文件 ...

apply plugin: 'com.android.application'
//apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.1'
    defaultConfig {
        applicationId "com.pedrocarrillo.expensetracker"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 3
        versionName "1.2"
    }

    signingConfigs {
        release {
            def Properties localProps = new Properties()
            localProps.load(new FileInputStream(file('../local.properties')))
            storeFile file("tracker_expense.jks")
            storePassword localProps["storePass"]
            keyAlias localProps["alias"]
            keyPassword localProps["pass"]
        }
    }

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


dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    //    compile 'com.google.android.gms:play-services:7.8.0'
    compile 'com.android.support:gridlayout-v7:23.0.1'
    compile 'com.android.support:support-annotations:23.0.1'
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:design:23.0.1'
    compile 'com.android.support:recyclerview-v7:23.0.1'
    compile 'com.android.support:cardview-v7:23.0.1'
    compile 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
    compile 'io.realm:realm-android:0.82.2'
    compile 'com.github.PhilJay:MPAndroidChart:v2.1.4'
}

顶级文件中,您必须删除以下行:

apply plugin: 'com.android.application'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到ID为“ com.android.application”的插件 - Plugin with id 'com.android.application' not found “找不到id'com.android.application'的插件” - “Plugin with id 'com.android.application' not found” 找不到ID为“ com.android.application”的插件 - plugin with id 'com.android.application' not found Android Studio错误:(3,0)找不到ID为'com.android.application'的插件 - Android Studio Error:(3, 0) Plugin with id 'com.android.application' not found Android studio:找不到ID为'com.android.application'的插件 - Android studio : Plugin with id 'com.android.application' not found Android Studio:找不到ID为“ com.android.application”的插件 - Android Studio: Plugin with id 'com.android.application' not found Android Studio错误:(1,0)找不到ID为'com.android.application'的插件 - Android Studio Error:(1, 0) Plugin with id 'com.android.application' not found 无法修复“未找到 ID 为 'com.android.application' 的插件” - Unable to fix “Plugin with id 'com.android.application' not found” 错误:未找到 ID 为“com.android.application”的插件 - ERROR: Plugin with id 'com.android.application' not found 未找到 ID 为“com.android.application”的插件问题 - Plugin with id 'com.android.application' not found issue
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM