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 小时前
DevUI与企业级中后台系统融合:低代码表单构建器实战
android·rxjava·devui
烤麻辣烫2 小时前
黑马程序员苍穹外卖后端概览
xml·java·数据库·spring·intellij-idea
暗碳2 小时前
安卓abx二进制xml文件转换普通xml文件
android·xml
4z332 小时前
Android15 Framework(3):系统服务进程 SystemServer 解析
android·源码阅读
没有了遇见3 小时前
Android 之Google Play bundletool 校验 AAB包
android·google
yuanhello3 小时前
【Android】Android的键值对存储方案对比
android·java·android studio
Ditglu.3 小时前
CentOS7 MySQL5.7 主从复制最终版搭建流程(避坑完整版)
android·adb
恋猫de小郭3 小时前
Android Studio Otter 2 Feature 发布,最值得更新的 Android Studio
android·前端·flutter
走在路上的菜鸟4 小时前
Android学Dart学习笔记第十二节 函数
android·笔记·学习·flutter
没有了遇见4 小时前
Android + Google Play:老项目适配实战指南
android·google