cordova-node-xcode
cordova-node-xcode copied to clipboard
How to use addResourceFile
I want to add localized content, use addResourceFile, but keep prompting Cannot read property 'path' of null
Code: var languageResourceFile = myProj.addResourceFile("InfoPlist.strings"); if (languageResourceFile){ myProj.addToPbxResourcesBuildPhase(languageResourceFile); myProj.addToPbxBuildFileSection(languageResourceFile); fs.writeFileSync(projectPbxprojNamePath, myProj.writeSync()); }
For others who run into this issue, the trick is to have a Resources
folder in your project.