apache / apache/cordova-node-xcode

How to use addResourceFile

未关闭
#83 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
217
派生
102
平均合并
2 天 3 小时
30 天内合并 PR
6

描述

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());
}

贡献指南

打开贡献指南

调研方向

从所提供代码中的 addResourceFile 调用开始,在添加 InfoPlist.strings 时复现“Cannot read property 'path' of null”错误。跟踪返回的 languageResourceFile 经过 addToPbxResourcesBuildPhase 和 addToPbxBuildFileSection 的过程;完成的标准是已添加本地化内容,并且 projectPbxprojNamePath 在没有该错误的情况下写入。

由索引模型根据 Issue 内容生成。

评估

技术栈
ios, javascript, nodejs
领域
build-system, mobile-dev
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。