leogoesger opened a new issue #764: could not find -Info.plist file, or config.xml file after adding extension, cordova build URL: https://github.com/apache/cordova-ios/issues/764 # Bug Report I have included the fix on the bottom. I am pretty new at Cordova, someone else should take the lead and figure out a better solution than mine. ## Problem Cannot find `*-info.plist or config.xml` error when adding extension in Xcode. In a new cordova repo. After an extension is installed, depends on how you name the extension in Xcode, it will trigger a build error when running `cordova build ios` ## How to reproduce <!-- Include all relevant information that might help understand and reproduce the problem --> 1. Start a fresh repo 2. Run all the cordova install, build commands 3. Open xcode, add extension, name it `OneTwoThree`, I used 4. Run cordova build 5. Failes ## How we solve it In `ios/cordova/lib/projectFile.js`, we found this. ``` var xcBuildConfiguration = xcodeproj.pbxXCBuildConfigurationSection(); var plist_file_entry = _.find(xcBuildConfiguration, function(entry) { return entry.buildSettings && entry.buildSettings.INFOPLIST_FILE; }); ``` Log `plist_file_entry` returns the path of the `OneTwoThree` extension, instead of the project path. We fixed it by adding one more condition: ``` var projectName = fs .readdirSync(project_dir) .find(d => d.includes(".xcworkspace")) .replace(".xcworkspace", ""); var xcBuildConfiguration = xcodeproj.pbxXCBuildConfigurationSection(); var plist_file_entry = _.find(xcBuildConfiguration, function(entry) { return ( entry.buildSettings && entry.buildSettings.INFOPLIST_FILE && entry.buildSettings.INFOPLIST_FILE.includes(projectName) ); }); ``` ### Environment, Platform, Device <!-- In what environment, on what platform or on which device are you experiencing the issue? --> IOS ### Version information Latest ## Checklist <!-- Please check the boxes by putting an x in the [ ] like so: [x] --> - [x] I searched for existing GitHub issues - [x] I updated all Cordova tooling to most recent version - [x] I included all the necessary information above
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
