could not find -Info.plist file, or config.xml file after adding extension, cordova build, with FIX
See original GitHub issueBug Report
I have included the fix on the bottom. I am pretty new at Cordova, someone else should take a look.
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
- Start a fresh repo
- Run all the cordova install, build commands
- Open xcode, add extension, name it
OneTwoThree
- Run cordova build
- Throws here
How did 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, it basically search through that path, and find your project name by finding a file name ending with .xcworkspace
. Not sure how reliable is this.
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
IOS
Version information
Latest
Checklist
- I searched for existing GitHub issues
- I updated all Cordova tooling to most recent version
- I included all the necessary information above
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:46 (13 by maintainers)
Top Results From Across the Web
Cordova ios adding extension - Error: could not find
The cordova found the wrong Info.plist. Maybe you manually created something in the platforms/ios, like some extensions or appclip.
Read more >"could not find -Info.plist file, or config.xml file." on iOS build
Hey all, I am trying to build a project for iOS using ionic build ios and I get the error could not find...
Read more >[Resolve]-Cordova ios adding extension - Error: could not find
Coding example for the question Cordova ios adding extension - Error: could not find -Info.plist file, or config.xml file.
Read more >Re: Getting cordova build error after adding watch app ...
Could not find -Info.plist file, or config.xml file. issue got resolved but > throwing following exception when I run cordova build ios.
Read more >Migrating a Web App Using Cordova to Capacitor
Initialize your app with Capacitor. Some of the information you will be prompted for is available in the Cordova config.xml file: The app...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If anyone need a quick fix, this is what worked for us. I submitted a PR a long time ago, I think everyone got busy.
ios/cordova/lib/projectFile.js, manually modify those. replace, around 43, after prettier
with
This is still a major nasty BUG. Unable to even add a plugin if we have an extension on the project. The workaround above works ok