iosswiftxcodescenekiton-demand-resources

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


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

Solution

  • Product -> Scheme -> Edit Scheme

    Please go to edit scheme and make Build configuration from debug to release and then check. Please don't forgot to Clean using "command + option + shift + k" before creating archive.

    It will resolve your issue.