背景:
- 我正在开发一个链接到firebase的kotlin android应用程序,该应用程序已上传到谷歌Playstore.我需要将相同的应用程序上传到具有不同ID和名称以及新的firebase帐户的Google Playstore .而且我不想维护多个代码库.
我做了一些研究,发现在应用程序级别gradle中使用不同的产品风格,我可以创建具有不同应用程序ID的多个apk.
示例:app/gradle
productFlavors {
pro {
applicationId = "com.example.my.pkg.pro"
}
free {
applicationId = "com.example.my.pkg.free"
}
}
buildTypes {
debug {
applicationIdSuffix ".debug"
}
}
我想知道的是,我计划为每种apk使用不同的firebase项目
举个例子,让我们说
- com.google.abc对于此apk,我需要链接abc firebase项目-google-services_abc.json
- com.google. dev-对于这个apk,我需要链接edf firebase项目-google-services_def.json
- com.google.ghi -对于这个apk,我需要链接ghi firebase项目-google-services_ghi.json
我需要维护单个代码库,但需要具有不同的应用程序ID才能作为不同的应用程序发布到Playstore.我需要让每个应用程序使用不同的firebase项目.
谢谢你