【发布时间】:2021-02-26 08:15:01
【问题描述】:
我有 3 种口味,每种口味都应该有不同的权限。 我的口味是这样定义的:
allPermissions {
dimension "permissions"
manifestPlaceholders = [excludeCallLogPermission: "false", excludeSmsPermission: "false"]
}
noSmsPermission {
dimension "permissions"
manifestPlaceholders = [excludeSmsPermission: "true"]
}
noSmsNoCallogPermission {
dimension "permissions"
manifestPlaceholders = [excludeCallLogPermission: "true", excludeSmsPermission: "true"]
}
在我的清单中我有这个:
<uses-permission android:name="android.permission.READ_CALL_LOG"
tools:remove="${excludeCallLogPermission}"/>
<uses-permission android:name="android.permission.SEND_SMS"
tools:remove="${excludeSmsPermission}"/>enter code here
它没有给出任何错误和构建,但应用程序具有提到的 2 个权限,即使风味设置为 false,因此它不起作用。
如果我尝试使用 tools:node="${excludeSmsPermission}" 并将其值设置为删除,我会收到此警告
【问题讨论】:
-
对于每种风味,您必须定义一个包含不相似之处的清单
-
遗憾的是,这种方法不适用于我的项目结构
标签: android permissions manifest