iOS 应用程序中的按需资源 AppStore 上传失败 - 不允许的路径

On Demand Resource AppStore Upload Failure in iOS application - Disallowed Paths

我有一个使用 ARKit 的 应用程序。直到当前版本,所有资产都包含在应用程序包本身中,用户使用该应用程序似乎没有问题。

但是,我想在应用程序上启用按需资源,以便可以从 AppStore 下载较新的模块(游戏)的资源,从而避免应用程序过大。根据 iOS 文档,我能够使用 ODR 并且该应用程序在我的设备上运行良好。它正在按应有的方式使用 ODR 加载资源。

但是在上传到AppStore进行App Review时,我遇到了错误:

我的特定 SCNAssets 文件夹(已标记)的文件夹结构如下:

请注意,该应用程序在我的设备上使用 ODR 时运行良好。我做了以下并尝试了多次,但无济于事。

  1. 正在创建一个干净的版本。
  2. 更改版本/构建。
  3. 确保在构建设置等中启用了 ODR - 所有卫生 steps.And 它是 全部 XCode,没有我正在使用的平台(例如 Xamarin, 等等)
  4. 使用现有的 SO 相关解决方案。

Apple 没有太多关于启用 ODR 的应用程序的 AppStore 上传问题的文档。我想知道在标记的资源文件夹中,我们是否也可以有其他文件夹,因为我的文件夹结构是正确的 - 不确定这是否是原因,因为附加的错误指向我的文件夹结构中的所有文件夹.

将不胜感激。 目前,我消除了对 ODR 的依赖并构建了 w/o 它,但是这不能持续很长时间。 注:资产均为scn文件、scn粒子系统和图片。

访问 ODR 的代码如下(简洁),但是如果代码适用于我的设备,它应该适用于其他地方。我认为这个问题可能与文件夹排列有关。

ODR 经理:

class ODRManager {

    static let shared = ODRManager()
    var currentRequest: NSBundleResourceRequest?
    var currentProgressFractionCompleted: Double?

    func requestSceneWith(tag: String, onSuccess: @escaping () -> Void, onFailure: @escaping (NSError) -> Void) {

        currentRequest = NSBundleResourceRequest(tags: [tag])

        guard let request = currentRequest else { return }

        request.beginAccessingResources { (error: Error?) in
            if let error = error {
                onFailure(error as NSError)
                return
            }
            onSuccess()
        }
    }
}

在 ViewController

内访问 ODR
// tagName is the name of the tag on the ODR related scnassets folder.

ODRManager.shared.requestSceneWith(tag: tagName, onSuccess: {
    DispatchQueue.main.async {
        self.game = self.gameFactory.createGame(...)
}, onFailure: { (error) in
    self.threeSurfaceLabel.text = "Problem with downloading content. Make sure internet connection is working, and restart."
})

Product -> Scheme -> Edit Scheme

请去edit scheme 做build configuration 从debug到release再检查。请不要忘记在创建存档之前使用 "command + option + shift + k" 清理。

它将解决您的问题。

仔细查看错误消息后,您可以看到错误仅引用了 .DS_Store 个文件。

.DS_Store 文件是由查找器创建的隐藏文件,用于存储每个文件夹的演示设置。

解决方案是在构建之前删除项目子目录中的所有 .DS_Store 文件。

  1. 关闭Xcode
  2. 打开终端并 cd 到您的项目目录
  3. 键入查找。 -name '.DS_Store' -type f delete
  4. 打开 Xcode,加载您的项目,清理、重建、存档并上传到 AppStore。