apache / apache/cordova-node-xcode
How to use addResourceFile
- Dominant language
- JavaScript
- Stars
- 217
- Forks
- 102
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 6
Description
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());
}
Contributor guide
Research direction
Start with the addResourceFile call in the supplied code and reproduce the “Cannot read property 'path' of null” error while adding InfoPlist.strings. Trace the returned languageResourceFile through addToPbxResourcesBuildPhase and addToPbxBuildFileSection; done means localized content is added and projectPbxprojNamePath is written without the error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, javascript, nodejs
- Domain
- build-system, mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100