簡體   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