相关文章推荐
大力的椰子  ·  Android ...·  6 月前    · 
犯傻的海龟  ·  C#/VB.NET ...·  1 年前    · 
深沉的大白菜  ·  Python解包和压包 - ...·  1 年前    · 

feature andoid模块 - 不允许使用应用插件。'com.android.feature'

0 人关注

我正试图在安卓系统中创建一个功能,但我得到了以下错误

正在执行任务。[:app:assembleDebug] 在项目中 C:\Users\wilso\OneDrive\Documents\retrofit_system\retrofit_system

配置项目 :feature:webview 警告:com.android.feature插件已被废弃,并将在2019年底前删除。请 转而使用动态特性或库。欲了解更多关于 更多关于将您的应用程序转换为使用Android App Bundles的信息,请访问 https://developer.android.com/topic/google-play-instant/feature-module-migration 警告:com.android.feature插件已被废弃,并将在2019年底前被移除。 将在2019年年底前删除。请改用动态特性或 库。欲了解更多关于将你的应用程序转换为 使用安卓应用包的更多信息,请访问 https://developer.android.com/topic/google-play-instant/feature-module-migration

失败。构建失败,出现异常。

  • 出了什么问题。在配置项目':feature:webview'时出现了问题。

    kotlin-android "希望有一个Android Gradle插件被应用到该项目中。 * android * com.android.application * android-library * com.android.library * com.android.test * com.android.feature * com.android.dynamic-feature * com.android.instantapp

  • 尝试一下。用--stacktrace选项运行以获得堆栈跟踪。用--info或--debug选项运行,获得更多的日志输出。用--scan选项运行,以获得完整的洞察力。

  • 获取更多帮助,请访问 https://help.gradle.org

  • 构建失败,耗时383ms

    gradle是下一个

    apply plugin: 'com.android.feature'
    apply plugin: 'kotlin-android'
    android {
        defaultConfig {
            consumerProguardFiles 'consumer-proguard-rules.pro'
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        lintOptions {
            disable 'RtlEnabled'
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    dependencies {
    

    我搜索了任何解决方案,但我什么也得不到。

    如果我使用下一个gradle,它的功能是

    apply plugin: 'com.android.application'
    apply plugin: 'kotlin-android'
    apply plugin: 'kotlin-android-extensions'
    android {
        compileSdkVersion 29
        buildToolsVersion "29.0.3"
        defaultConfig {
            applicationId "com.co.webview"
            minSdkVersion 21
            targetSdkVersion 29
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
        implementation 'androidx.appcompat:appcompat:1.1.0'
        implementation 'androidx.core:core-ktx:1.2.0'
        implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'androidx.test.ext:junit:1.1.1'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    

    但我不想创建一个应用程序,因为我想创建一个功能。

    5 个评论
    "com.android.feature插件已被废弃,并将在2019年底前删除。"我很确定我们是在2020年。
    是的,我理解日志,但我找不到创建功能的解决方案。
    I think this 文章 might help you.
    我做了一个测试,我的问题被解决了,但我不明白为什么下一个标签会影响构建'apply plugin:kotlin-android"。如果我把它去掉,我的应用程序就能建立起来。'kotlin-android'。
    kotlin-android 期望找到一个android插件,如堆栈跟踪所示。很可能是 com.android.feature 插件被删除了,所以在你构建时没有android插件。替换代码0】只是相当于 kotlin 的gradle插件,但适用于Android。
    java
    android
    swift
    react-native
    kotlin
    Alejandro Gonzalez
    Alejandro Gonzalez
    发布于 2020-03-23
    2 个回答
    Alejandro Gonzalez
    Alejandro Gonzalez
    发布于 2021-07-16
    已采纳
    0 人赞同

    我做了一个测试,它的功能是

    如果我使用下一个gradle,我的应用程序就可以构建了

    apply plugin: 'com.android.feature'
    android {
        defaultConfig {
            consumerProguardFiles 'consumer-proguard-rules.pro'
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        lintOptions {
            disable 'RtlEnabled'
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    dependencies {
    

    但如果我使用下一个gradle,它就不能发挥作用。

    apply plugin: 'com.android.feature'
    apply plugin: 'kotlin-android'
    android {
        defaultConfig {
            consumerProguardFiles 'consumer-proguard-rules.pro'
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        lintOptions {
            disable 'RtlEnabled'
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    dependencies {