Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit e274cd5

Browse files
Unable to copy google-services.json. #701
1 parent da143ab commit e274cd5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

publish/scripts/installer.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,10 +624,16 @@ module.exports = function($logger, $projectData, hookArgs) {
624624
if (hookArgs.platform.toLowerCase() === 'android') {
625625
var sourceGoogleJson = path.join($projectData.appResourcesDirectoryPath, "Android", "google-services.json");
626626
var destinationGoogleJson = path.join($projectData.platformsDir, "android", "app", "google-services.json");
627+
var destinationGoogleJsonAlt = path.join($projectData.platformsDir, "android", "google-services.json");
627628
if (fs.existsSync(sourceGoogleJson) && fs.existsSync(path.dirname(destinationGoogleJson))) {
628629
$logger.out("Copy " + sourceGoogleJson + " to " + destinationGoogleJson + ".");
629630
fs.writeFileSync(destinationGoogleJson, fs.readFileSync(sourceGoogleJson));
630631
resolve();
632+
} else if (fs.existsSync(sourceGoogleJson) && fs.existsSync(path.dirname(destinationGoogleJsonAlt))) {
633+
// NativeScript < 4 doesn't have the 'app' folder
634+
$logger.out("Copy " + sourceGoogleJson + " to " + destinationGoogleJsonAlt + ".");
635+
fs.writeFileSync(destinationGoogleJsonAlt, fs.readFileSync(sourceGoogleJson));
636+
resolve();
631637
} else {
632638
$logger.warn("Unable to copy google-services.json.");
633639
reject();

0 commit comments

Comments
 (0)