【发布时间】:2018-04-07 15:20:42
【问题描述】:
在 Cordova 构建中,我正在尝试为我的 iOS 应用程序添加设置。我已经在Settings.bundle/Root.plist 文件中定义了这些设置。我想要的只是将Settings.bundle 及其子项复制到 XCode 项目中。
我正在尝试使用resource-file 声明来做到这一点:
<platform name="ios">
<resource-file src="res/ios/Settings.bundle" />
...
</platform>
当我进行构建时,该文件夹被添加到我的项目中 3 次,而不是仅一次,并且该文件夹中的任何文件都不会被复制。我在日志输出中看到该资源执行了 3 个CpResource 语句。
CpResource Anamnese\ mobil/Resources/res/ios/Settings.bundle build/emulator/Anamnese\ mobil.app/Settings.bundle
CpResource Anamnese\ mobil/Resources/res/ios/Settings.bundle build/emulator/Anamnese\ mobil.app/Settings.bundle
CpResource Anamnese\ mobil/Resources/res/ios/Settings.bundle build/emulator/Anamnese\ mobil.app/Settings.bundle
这与我在生成的 XCode 项目中看到的一致:该文件夹存在 3 次,但它没有内容。我玩弄了 Settings.bundle 的位置和里面的文件数量,看看是否与执行次数有关,但无济于事。
那么,我的问题是,如何使用 Cordova 正确地将设置添加到 iOS 应用?
或者,如果我停留在这个级别的分析:我如何正确地将文件夹结构复制到 iOS 项目中?
【问题讨论】:
标签: ios cordova settings.bundle