简体   繁体   中英

Android Studio: Plugin with id 'com.android.feature' not found

I moved an android studio project onto another computer and I got this error when the gradle was syncing:

A problem occurred evaluating project ':base'.
> Plugin with id 'com.android.feature' not found.

Here is the code in build.gradle (:base)

apply plugin: 'com.android.feature'

configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-annotations:23.1.1'
    }
}

android {
    compileSdkVersion 28
    baseFeature true

    defaultConfig {
       minSdkVersion 26
       targetSdkVersion 28
       versionCode 1
       versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {

    //noinspection GradleCompatible
    api 'com.android.support:appcompat-v7:28.0.0'
    api 'com.android.support.constraint:constraint-layout:2.0.4'

    application project(':app')
    feature project(':app')
    implementation fileTree(include: ['*.jar'], dir: 'libs')



}

Here are the gradle versions:

在此处输入图像描述

The com.android.feature plugin has been deprecated for some time and was finally removed in 4.0.0 of the Android Gradle Plugin. See here for more details.

So, it looks like you have 2 options.

  1. Migrate your app to work with the newer app bundling, if that applies to you.
  2. Downgrade to 3.6.0 of the Android Gradle Plugin.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM