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 小时前
AI Agent 开始操作真实手机:移动端自动化的 3 个新考点
android·ai编程
帅得不敢出门2 小时前
Android Framework关闭软件低电关机功能测试PMIC低电保护
android
恋猫de小郭2 小时前
Flutter + EmbeddingGemma 2,谷歌发布完全端侧的 AI Edge Foresight
android·前端·flutter
墨天梦3 小时前
B16_Material主题与可访问交互
android·kotlin·交互
弯_弯4 小时前
企业知识库 RAG 落地:从 Demo 到生产,四条工程链路与参数级自查
android·java·javascript
晚风叙码5 小时前
MySQL 表的约束详解:从空属性到外键
android·数据库·mysql·adb
alexhilton15 小时前
模块化Jetpack Compose架构
android·kotlin·android jetpack
厮年断弦18 小时前
AI 辅助开发实录:一周做完一个 Android 本地音乐播放器,这些坑替你踩了
android
hai_android18 小时前
InputStage 责任链核心执行流程
android·android studio·android jetpack
mmsx21 小时前
Android 测绘计算工程化:七四参数、高程拟合与单位系统
android·kotlin