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 小时前
B08_Fragment事务通信与双生命周期
android
Kapaseker1 小时前
Android 以后可能不会再有横竖屏适配了
android·kotlin
墨天梦2 小时前
B13_通知图片相机与影音
android·数码相机·kotlin
事圆则缓2 小时前
Android 一次性事件怎么设计:Channel、SharedFlow 还是 UI State?
android·ui
Android系统攻城狮15 小时前
Linux Gstreamer深度解析之gst_audio_encoder_set_frame_max调用流程与实战(六十一)
android·linux·运维·音视频·gstreamer音视频·音视频进阶·gstreamer音视频进阶
传奇开心果编程18 小时前
【Compose Multiplatform 跨端开发学与练】第7课 平台适配与互操作
android·windows·学习·ui·ios·kotlin·composer
mmsx18 小时前
Android 地图数据链路:从 GDAL、KML 到多引擎适配
android·kotlin
2601_9689007718 小时前
大模型版本回归评估实战:从能力指标到额度口径的完整链路
android·数据挖掘·回归
ao-weilai20 小时前
MySQL数据库:基本查询
android·数据库·mysql
事圆则缓21 小时前
Kotlin 泛型方差实战:out、in、星投影与类型擦除
android·开发语言·kotlin