Android渠道包配置不同AndroidManifest.xml

开发中不同的渠道包需要使用不同的AndroidManifest.xml,比如Flavor1 需要添加android:sharedUserId="android.uid.system"配置,可以新建一个AndroidManifest_system.xml

xml 复制代码
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:sharedUserId="android.uid.system">
</manifest>

在gradle中配置:

xml 复制代码
 sourceSets {
        Base {
            manifest.srcFile 'src/main/AndroidManifest.xml'
        }
        Flavor1 {
            manifest.srcFile 'src/main/AndroidManifest_system.xml'
        }
 }

Flavor1 渠道打包会融合AndroidManifest.xml和AndroidManifest_system.xml两个配置文件

相关推荐
梦幻通灵1 小时前
Mysql字段判空实用技巧
android·数据库·mysql
龘龍龙4 小时前
Python基础(九)
android·开发语言·python
gjc5924 小时前
MySQL隐蔽 BUG:组合条件查询无故返回空集?深度排查与规避方案
android·数据库·mysql·bug
梨落秋霜5 小时前
Python入门篇【元组】
android·数据库·python
zh_xuan5 小时前
kotlin定义函数和变量
android·开发语言·kotlin
Digitally7 小时前
Android 上的联系人备份和恢复:5 种可靠且方便的方法
android
默|笙7 小时前
【Linux】进程控制(3)进程程序替换
android·linux·运维
国家二级编程爱好者7 小时前
Android Lottie使用,如何自定义LottieView?
android·前端
bst@微胖子8 小时前
CrewAI+FastAPI实现营销战略协助智能体项目
android·数据库·fastapi
子林Android8 小时前
AndroidStudio修改.android、.gradle、.AndroidStudio路径,释放C盘空间
android·android studio