android - 如何在 Android Studio 中使用风味
问题描述
在我的应用程序中,我想在我的应用程序中使用风味。
我将以下代码添加到build.gradle
文件中,但是当在设备上运行应用程序时(单击 AndroidStudio 中的运行按钮)显示错误数据!
我的口味代码:
defaultConfig {
applicationId "com.app.app"
minSdkVersion 17
targetSdkVersion 29
versionCode 13
versionName "1.0.13"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
//Custom flavors
flavorDimensions "default"
productFlavors {
appFlav2 {
applicationId "com.app.app.myapp2"
resValue "string", "app_name", "App name 2"
resValue "string", "appDescription", "description info 2"
manifestPlaceholders = [
appIcon: "@drawable/logo_niaz"
]
}
appFlav3 {
applicationId "com.app.app.myapp3"
resValue "string", "app_name", "App name 3"
resValue "string", "appDescription", "description info 3"
manifestPlaceholders = [
appIcon: "@drawable/logo_niaz"
]
}
appFlav {
applicationId "com.app.app"
resValue "string", "app_name", "App name"
resValue "string", "appDescription", "description info"
manifestPlaceholders = [
appIcon: "@drawable/launcher"
]
}
}
}
但是在设备上运行应用程序时会显示这种风格的信息:appFlav3。但我的默认风味是appFlav!
我该如何解决?
解决方案
推荐阅读
- java - Android / Java,观察者更新参数标准化:如何覆盖枚举
- c# - 旋转相机位置 xy 的逆对象
- typeorm - 覆盖 TypeORM 列选项
- visual-studio-code - vscode 中是否有本地 api 来按 glob 匹配文档文件?
- git - Git-LFS 在拉取过程中失败
- python - 映射数据框
- ssl - 无法使用 Let's Encrypt 证书通过 ldaps 连接到服务器
- c# - 来自 Azure 管道的 mongodb 超时错误 C#
- matlab - 我在哪里可以找到 MATLAB 映射工具箱中的所有数据?
- pyspark - 如何使用 pyspark 中的窗口应用重新分区?