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属性,但请注意,在未来的版本中这些属性将被完全删除。因此,建议您在下一个适当的时间升级到非孵化版本的属性。

相关内容

热门资讯

透视胜率!hhpoker有透视... 透视胜率!hhpoker有透视功能吗(透视)开挂辅助挂(果然是有挂)-哔哩哔哩1、hhpoker有透...
透视辅助!德扑圈有透视吗,微信... 透视辅助!德扑圈有透视吗,微信小游戏万年修改器,总是有挂(教你必胜教程)-哔哩哔哩;1、下载好微信小...
辅助透视!aapoker辅助器... 辅助透视!aapoker辅助器是真的吗,wepoker有人用过吗,课程教程(竟然真的是有挂)-哔哩哔...
透视智能!拱趴大菠萝怎么开挂(... 透视智能!拱趴大菠萝怎么开挂(透视)开挂辅助神器(切实是真的挂)-哔哩哔哩拱趴大菠萝怎么开挂是一种具...
透视辅助!wepoker插件下... 透视辅助!wepoker插件下载,一起宁德钓蟹黑科技辅助软件推荐,一直有挂(总结科技教程)-哔哩哔哩...
透视黑科技!wepoker辅助... 透视黑科技!wepoker辅助插件功能,hhpoker有后台操作吗,总结教程(总是是真的挂)-哔哩哔...
透视助手!hhpoker买挂(... 透视助手!hhpoker买挂(透视)开挂辅助技巧(好像存在有挂)-哔哩哔哩1、下载好hhpoker买...
有玩家发现!hhpoker有透... 有玩家发现!hhpoker有透视功能吗,广西老友玩有破解视频,原来有挂(分享线上教程)-哔哩哔哩1、...
透视工具!sohoo poke... 透视工具!sohoo poker辅助,sohoo poker辅助,法子教程(其实真的有挂)-哔哩哔哩...
透视系统!aapoker透视脚... 透视系统!aapoker透视脚本入口(透视)开挂辅助技巧(真是真的是有挂)-哔哩哔哩透视系统!aap...