繁体   English   中英

Android Studio:未找到 ID 为“com.android.feature”的插件

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

我将 android 工作室项目移动到另一台计算机上,当 gradle 同步时出现此错误:

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

这是 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')



}

以下是 gradle 版本:

在此处输入图像描述

com.android.feature插件已被弃用一段时间,最终在 AndroidDC37B5CC41FB5671 的 4.0.0 中删除有关更多详细信息,请参见此处

所以,看起来你有两个选择。

  1. 迁移您的应用程序以使用较新的应用程序捆绑,如果这适用于您。
  2. 降级到 Android Gradle 插件的 3.6.0。

暂无
暂无

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

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