From 1e344764f7c12540018444aac50f6143668dbb52 Mon Sep 17 00:00:00 2001 From: Niklas Merz Date: Tue, 14 Jan 2020 09:06:11 +0100 Subject: [PATCH] Fix build error with extensions Fix "Could not parse *-info.plist or config.xml". Proposed fix, see #764 Co-Authored-By: Leo Qiu --- bin/templates/scripts/cordova/lib/projectFile.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/templates/scripts/cordova/lib/projectFile.js b/bin/templates/scripts/cordova/lib/projectFile.js index 35a5a9178d..3b7addf845 100644 --- a/bin/templates/scripts/cordova/lib/projectFile.js +++ b/bin/templates/scripts/cordova/lib/projectFile.js @@ -40,8 +40,18 @@ function parseProjectFile (locations) { const xcodeproj = xcode.project(pbxPath); xcodeproj.parseSync(); + const projectName = fs + .readdirSync(project_dir) + .find(d => d.includes(".xcworkspace")) + .replace(".xcworkspace", ""); const xcBuildConfiguration = xcodeproj.pbxXCBuildConfigurationSection(); - const plist_file_entry = _.find(xcBuildConfiguration, entry => entry.buildSettings && entry.buildSettings.INFOPLIST_FILE); + const plist_file_entry = _.find(xcBuildConfiguration, entry => { + return ( + entry.buildSettings && + entry.buildSettings.INFOPLIST_FILE && + entry.buildSettings.INFOPLIST_FILE.includes(projectName) + ); + }); const plist_file = path.join(project_dir, plist_file_entry.buildSettings.INFOPLIST_FILE.replace(/^"(.*)"$/g, '$1').replace(/\\&/g, '&')); const config_file = path.join(path.dirname(plist_file), 'config.xml');