我正在脚本中自定义我的 Android 应用程序的 APK 文件的名称,build.gradle
如下所示:
android {
defaultConfig {
project.ext.set("archivesBaseName", "MyApplication");
}
}
现在我正在使用产品口味:
android {
productFlavors {
green {
applicationId "com.example.myapplication.green"
}
blue {
applicationId "com.example.myapplication.blue"
}
}
}
有没有办法自定义每个 APK的名称?我尝试了成功,archiveBaseName
也baseName
没有成功。最后,我想提出以下文件:
build/outputs/apk/Blue-debug-1.2.1.apk
build/outputs/apk/Blue-debug-unaligned.apk
build/outputs/apk/Blue-release-1.2.1.apk
build/outputs/apk/Blue-release-unaligned.apk
build/outputs/apk/Green-debug-1.2.1.apk
build/outputs/apk/Green-debug-unaligned.apk
build/outputs/apk/Green-release-1.2.1.apk
build/outputs/apk/Green-release-unaligned.apk