apache / apache/cordova-node-xcode

How to use addResourceFile

Open
#83 1 comment 0 reactions 0 assignees View on GitHub
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
![2](https://user-images.githubusercontent.com/21995889/71520174-b8c15d00-28f5-11ea-8937-6b26ba901222.png)
![1](https://user-images.githubusercontent.com/21995889/71520195-ce368700-28f5-11ea-9695-4c25f160717e.png)

Code:
var languageResourceFile = myProj.addResourceFile("InfoPlist.strings");
if (languageResourceFile){
myProj.addToPbxResourcesBuildPhase(languageResourceFile);
myProj.addToPbxBuildFileSection(languageResourceFile);
fs.writeFileSync(projectPbxprojNamePath, myProj.writeSync());
}

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.