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

相关推荐
新镜19 小时前
【Flutter】LTR/RTL 阿拉伯语言/希伯来语言
android·flutter·ios·客户端
初级代码游戏1 天前
android开发:获取手机IP和UDP广播
android·udp·获取ip
阿杰 AJie1 天前
MySQL 聚合函数
android·数据库·mysql
孟秋与你1 天前
【安卓】开发一个读取文件信息的简易apk
android
42nf1 天前
Android Launcher3添加负一屏
android·launcher3·android负一屏
LcVong1 天前
老版本Android源码在新版本IDE打开的常规报错及解决方案
android·ide
别退1 天前
flutter_gradle_android
android·flutter
2501_944424121 天前
Flutter for OpenHarmony游戏集合App实战之黑白棋落子翻转
android·开发语言·windows·flutter·游戏·harmonyos
zhangphil1 天前
Android adb shell抓取trace(二)
android
2501_944424121 天前
Flutter for OpenHarmony游戏集合App实战之消消乐下落填充
android·开发语言·flutter·游戏·harmonyos