apache/cordova-node-xcode

How to use addResourceFile

Opened this issue · 1 comments

I want to add localized content, use addResourceFile, but keep prompting Cannot read property 'path' of null
2
1

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.