Search code examples
iosios9xcode7on-demand-resources

Xcode and iOS9's "Asset packs must be in /OnDemandResources" error


I updated to iOS 9 GM and Xcode 7 GM and am in the process of submitting an update to my game.

However, the validation process now comes up with an "Asset packs must be in /OnDemandResources." error.

enter image description here

Here's the log

2015-09-14 18:50:52 +0000 [MT] Failed to generate distribution items with error: Error Domain=IDEFoundationErrorDomain Code=1 "Unexpected asset pack at /Applications/churningseas.app/AssetPacks/Dropbox.assetpack. Asset packs must be in /OnDemandResources." UserInfo={NSLocalizedDescription=Unexpected asset pack at /Applications/churningseas.app/AssetPacks/Dropbox.assetpack. Asset packs must be in /OnDemandResources.}

2015-09-14 18:50:52 +0000 [MT] Presenting: Error Domain=IDEFoundationErrorDomain Code=1 "Unexpected asset pack at /Applications/churningseas.app/AssetPacks/Dropbox.assetpack. Asset packs must be in /OnDemandResources." UserInfo={NSLocalizedDescription=Unexpected asset pack at /Applications/churningseas.app/AssetPacks/Dropbox.assetpack. Asset packs must be in /OnDemandResources.}

And here is my Xcode directory, showing the Assetpacks are currently under Ressources (I went a little crazy with blurring, sorry about that):

enter image description here

I guess this is due to Apple's new "app thinning" system, which I'm not particularly wanting to use right now for a small update.

Is there a way to disable on-demand resources? If not, how to fix this (do I simply need to move my "Assetpacks" folder to another one called "OnDemandResources")? I so, where? I'm a little nervous to mess up my file structure...

Also, I did already look at the assets section of the build setting, and "Enable on-demand resources" was already set to "no"

enter image description here

any help is appreciated. Thanks a lot!


Solution

  • This seems to have become an issue since iOS 9 introduced on demand resources. The terms "AssetPacks" or "assetpack" inside folder references cause an error when attempting to validate an archive.

    Because this seems to effect Codea-exported projects under version 2.3.1 and earlier. Here is a fix specifically for a Codea exported project:

    • Find the file named libversion in the root of your exported project. It will contain a version number, most likely 2.3.1. Change it to 2.3.2
    • Delete libcodea.a and libtools.a from your Libs/ folder
    • Delete the "AssetPacks" folder reference from the "Resources" group in your exported Xcode project — if Xcode asks you to move the files to trash say NO.
    • In Finder: rename the "AssetPacks" folder to "Assets"
    • In Finder: Rename every "SomePack.assetpack" folder within it to "SomePack.assets"
    • Drag the root level "Assets" folder back into Xcode, tell Xcode to add this as a "Folder Reference" (not a "Group")

    There's a more in-depth discussion here https://bitbucket.org/TwoLivesLeft/core/issues/366/trying-to-export-xcode-file-so-i-can#comment-22075482