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

Viewed 249

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:

enter image description here

1 Answers

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.
Related