Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions publish/scripts/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,20 @@ module.exports = function($logger, hookArgs) {
if (forcePrepare) {
$logger.info('nativescript-plugin-firebase: running release build or change in environment detected, forcing prepare!');

const googleServicesValuesXmlPath = path.join(platformsDir, platform, "app", "build", "generated", "res", "google-services", isReleaseBuild ? "release" : "debug", "values")
const mergeDebugResourcesPath = path.join(platformsDir, platform, "app", "build", "intermediates", "incremental", isReleaseBuild ? "mergeReleaseResources" : "mergeDebugResources")

// The following files must be deleted for the google-services.json change to actually be reflected in the app
if (fs.existsSync(path.join(googleServicesValuesXmlPath, "values.xml"))) {
fs.unlinkSync(path.join(googleServicesValuesXmlPath, "values.xml"))
}
if (fs.existsSync(path.join(mergeDebugResourcesPath, "merger.xml"))) {
fs.unlinkSync(path.join(mergeDebugResourcesPath, "merger.xml"))
}
if (fs.existsSync(path.join(mergeDebugResourcesPath, "merged.dir", "values", "values.xml"))) {
fs.unlinkSync(path.join(mergeDebugResourcesPath, "merged.dir", "values", "values.xml"))
}

if (fs.existsSync(npfInfoPath)) { fs.unlinkSync(npfInfoPath); }
if (fs.existsSync(nsPrepareInfoPath)) { fs.unlinkSync(nsPrepareInfoPath); }

Expand Down