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

相关推荐
三少爷的鞋3 小时前
Android 协程实践:为什么不应将 `supervisorScope` 作为常规方案
android
承渊政道4 小时前
【从零开始大模型开发与微调:基于PyTorch与ChatGLM】(从ChatGLM本地化到LoRA、PEFT的高级微调)
android·人工智能·pytorch·chatglm·本地化部署·大模型开发与微调
2601_962885726 小时前
如何用 Python 判断一只股票“追涨”还是“抄底”更有效?
android·开发语言·python
素师良码6 小时前
第10篇:屏ESD Check内核逻辑驱动代码完整拆解
android
高晶6 小时前
Android 短信收发模块从零到实战:权限配置、界面设计、发送接收与兼容性适配全攻略
android·程序员
随遇丿而安6 小时前
第18周:ViewModel 基础功能 + 架构优化
android
泡海椒7 小时前
从 XML 到 Excel:JQuick-Excel 代理与解析器如何协作
xml·excel
问心无愧05139 小时前
[GXYCTF2019]Ping Ping Ping
android·笔记
事圆则缓9 小时前
Kotlin 异步与并发:从一次搜索请求走到状态流
android·开发语言·kotlin
帅得不敢出门10 小时前
Android Framework定制卸载确认窗口
android