Search code examples
swiftxcodeasset-catalogon-demand-resources

Asset Catalog Compile Error with On-Demand Resources: has no output specification


I've been trying to get On-Demand Resource to work but I keep getting this compile error:

/* com.apple.actool.errors */

: error: The tag combination "tagName" for "xxx.imageset/[email protected]" has no output specification.

I had a look at actool man page and there's an option:

--asset-pack-output-specifications filename

Which says:

Tells actool where to write the information about ODR resources found in the asset catalog. The emitted file will be a plist.

But I'm not really sure what to put as an argument/where this plist is used or even if this option is in the right track of fixing the error.


Solution

  • My coworkers and I struggled with this error for over a day and were only able to fix it by wiping our existing local repos and installing a fresh clone from our remote repos with the code that contains the on-demand resources.

    In our case, I was the one that created the on-demand resources functionality and did the tagging for the assets. I built and ran all of that code, and everything worked fine locally on my machine. I pushed those commits to our remote, and when my coworkers pulled they received the asset catalog compile error that you reported when they tried to build.

    I compared my build logs with those of my coworkers and found that I had the --asset-pack-output-specifications flag along with a filename whereas they did not, even though all of our production code was the same. I never set that flag manually myself during development, it was automatically generated at some point in the process but I have no idea where -- I didn't even know it existed until this build failure occurred. After struggling for many hours we noticed that if my coworkers deleted their local projects entirely and basically started fresh by installing a new project and repo again from the remote, they suddenly were able to build. They had already tried to clean and nuke their derived data, but that didn't work. Only totally deleting the repos and the projects entirely did the trick. Not sure why, but something about wiping the project and all associated directories and building themselves totally fresh from their own local machines triggered something that enabled the --asset-pack-output-specifications flag.