2

I have an application using ARKit. Till the current build, all assets were included in the app bundle itself and there seem to be no issue for users in using the application.

However, I wanted to enable On-Demand Resource on the app so that newer modules (games)'s resources could be downloadable from AppStore, thus obviating heavy app size. Following the iOS documentations, I was able to use ODR and the application was working all right on my device. It was loading resources using ODR as it should.

When uploading to AppStore for App Review, however, I encountered the error:

enter image description here

My folder structure for the specific SCNAssets folder (which is tagged) is below:

enter image description here

Please note that the app works perfectly using ODR on my device. I have done the following and tried multiple times, but to no avail.

  1. Creating a clean build.
  2. Changing the Version/ Build.
  3. Making sure ODR is enabled in Build Settings, etc. - all hygienic steps.And it's all XCode, there is no platform which I am using (such as Xamarin, etc.)
  4. Using existing SO related solutions.

There is not much documentation by Apple on issues related to AppStore upload for ODR enabled applications. I am wondering whether within the tagged resource folder, we can have other folders as well or not, as my folder structure is right now - not sure whether this can be the reason, since the error attached points to all the folders within my folder structure.

Help would be much appreciated. For now, I remove my reliance on ODR and built w/o it, however this cannot be sustained for long. Note: The assets are all scn files, scn particle systems and images.

Code to access ODR is below (with brevity), however it the code works with my device it should work elsewhere. I think the issue might be related to folder arrangement.

ODR Manager:

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

Accessing ODR within ViewController

// 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."
})
4

2 回答 2

1

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

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

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

  1. 关闭 Xcode
  2. 打开终端并 cd 到您的项目目录
  3. 键入查找。-name '.DS_Store' -type f 删除
  4. 打开 Xcode,加载您的项目,清理、重建、归档并上传到 AppStore。
于 2019-11-12T15:09:35.533 回答
0

产品 -> 方案 -> 编辑方案

请转到编辑方案并进行从调试到发布的构建配置,然后检查。请不要忘记在创建存档之前使用“command + option + shift + k”进行清理。

它将解决您的问题。

于 2018-05-16T06:49:53.947 回答