简体   繁体   中英

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/xxx@3x.png" 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.

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.

I just faced this issue and was totally against deleting my repo and cloning again.

I noticed that alongside this error, I also got a warning stating that I had assets under the same name (thus being duplicated).

Deleting the duplicated asset in order to get rid of the warning, fixed the compilation error.

Hope this helps someone, as deleting the repo and cloning again shouldn't be an option.

I just faced the issue.

I could solve it just by deleting on-demand resource tags and tagging them back again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM