AndroidGradle插件-如何替换孵化抽象,如defaultConfig?
创始人
2024-10-08 01:31:45
0

在Android Gradle插件版本3.0及以后,incubating抽象已被弃用。因此,我们需要使用非孵化版本的属性来替换它们。

以下是一个示例build.gradle文件,演示如何使用新的非incubating抽象:

android {
    defaultConfig {
        applicationId "com.example.myapp"
        minSdkVersion 21
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        // These attributes are now non-incubating
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

在代码中,我们使用非incubating版本的vectorDrawables.useSupportLibrarymultiDexEnabled来替换原来的vectorDrawables.defaultConfig.useSupportLibrarymultiDex.defaultConfig.enabled

如您的插件版本低于3.0,您可以继续使用incubating属性,但请注意,在未来的版本中这些属性将被完全删除。因此,建议您在下一个适当的时间升级到非孵化版本的属性。

相关内容

热门资讯

透视资料!如何下载德普之星辅助... 透视资料!如何下载德普之星辅助软件(AApoker透视软件)竟然是真的有辅助教程(哔哩哔哩)1、玩家...
透视妙招!wepoker可以开... 透视妙招!wepoker可以开透视吗(WePoKer规律)真是是有辅助插件(哔哩哔哩)1、透视妙招!...
透视练习!wepoker黑侠辅... 透视练习!wepoker黑侠辅助器(WePoKer开辅助)好像真的是有辅助教程(哔哩哔哩)1、透视练...
透视法门!pokemmo修改器... 透视法门!pokemmo修改器手机版(德普之星官网)原来真的是有辅助神器(哔哩哔哩)1、首先打开po...
透视指南!hhpoker透视脚... 透视指南!hhpoker透视脚本视频(HHpoker必备)总是有辅助软件(哔哩哔哩)在进入hhpok...
透视操作!wepoker辅助器... 透视操作!wepoker辅助器软件下载(AApoker辅助)确实真的有辅助神器(哔哩哔哩)1、wep...
透视大纲!有哪些免费的wpk作... 透视大纲!有哪些免费的wpk作必弊码(HHpoker必备)确实是有辅助神器(哔哩哔哩)1、用户打开应...
透视窍要!epoker透视底牌... 透视窍要!epoker透视底牌(HHpoker安装包)其实真的是有辅助插件(哔哩哔哩)1、epoke...
透视妙计!wepoker透视脚... 透视妙计!wepoker透视脚本是什么(HHpoker德州)本来真的是有辅助app(哔哩哔哩)1、点...
透视妙计!we poker辅助... 透视妙计!we poker辅助器下载(WePoKer数据)果然真的有辅助脚本(哔哩哔哩)1、打开软件...