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两个配置文件

相关推荐
向上_5035829123 分钟前
配置Protobuf输出Java文件或kotlin文件
android·java·开发语言·kotlin
陆业聪32 分钟前
AI 时代最被低估的工程师技能:把需求写清楚
android·人工智能·aigc
夏沫琅琊37 分钟前
Android 的 Activity 启动模式
android
zh_xuan1 小时前
Android compose Navigation 页面导航
android·compose
luanma1509802 小时前
PHP vs C#:30字秒懂两大语言核心差异
android·开发语言·python·php·laravel
luanma1509803 小时前
Laravel 7.X核心特性深度解析
android·开发语言·php·lua·laravel
运维老曾3 小时前
Flink 1.20 使用自带jdbc source 操作步骤
android·adb·flink
陆业聪5 小时前
2026 年还在靠「感觉」调性能?Android Profiler 这样用才对
android·人工智能·性能优化
草莓熊Lotso5 小时前
MySQL 多表连接查询实战:内连接 + 外连接
android·运维·数据库·c++·mysql
草莓熊Lotso6 小时前
Linux 进程信号深度解析(下):信号的保存、阻塞与捕捉
android·linux·运维·服务器·数据库·c++·性能优化