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

相关推荐
天涯海风6 分钟前
写一个录音并保存到手机的工具 安卓工具类
android·java·智能手机
黄林晴25 分钟前
Koin 开发者炸了!7 条规则根治运行时错误,自动扫描太香了
android
恋猫de小郭29 分钟前
Flutter 3.41.8 又双叒修复调试问题,草台班子日常 hotfix
android·前端·flutter
火山上的企鹅39 分钟前
QGC 二次开发(RTK):内置 NTRIP Client,实现 CORS 差分数据接入与 GPS_RTCM_DATA 转发
android·无人机·rtk·qgroundcontrol
Kapaseker41 分钟前
客官,你误会 Compose Strong Skipping 了
android·kotlin
张风捷特烈1 小时前
状态管理大乱斗#04 | Riverpod 源码评析 (上) - 核心架构
android·前端·flutter
大鹏说大话1 小时前
构造函数属性提升的利与弊:如何优雅地编写价值对象(Value Object)
android
大黄说说1 小时前
匹配表达式 vs. Switch语句:现代PHP中的条件逻辑重构
android·ide·android studio
fred_kang1 小时前
MySQL锁表诊断与解决方案
android·mysql·mariadb
未来之窗软件服务1 小时前
CICD 信发系统自动打包安卓签名apk—无相无界(7)—东方仙盟
android·仙盟创梦ide·东方仙盟·东方仙盟无相无界