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

相关推荐
YaBingSec23 分钟前
玄机靶场-2024ccb初赛sc05 WP
android·运维·网络·笔记·安全·ssh
常利兵30 分钟前
解锁Android嵌入式照片选择器,让你的App体验丝滑起飞
android
峥嵘life1 小时前
Android 切换用户后无法获取 MAC 地址分析解决
android·python·macos
JJay.1 小时前
Android BLE 为什么连上了却收不到数据
android
歪楼小能手1 小时前
Android16在开机向导最后添加一个声明界面
android·java·平板
夏沫琅琊1 小时前
Android联系人导入导出
android·kotlin
zh_xuan1 小时前
把Android Library 上传到github并在工程中引用该远程仓库
android·github·远程仓库
诸神黄昏EX1 小时前
Android Google MADA
android
盖丽男1 小时前
使用 GitHub Actions 自动打包 Android APK
android·github
小林望北1 小时前
Kotlin 协程:StateFlow 与 SharedFlow 深度解析
android·开发语言·kotlin