简体   繁体   English

带有按需资源的资产目录编译错误:没有输出规范

[英]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 */ / * com.apple.actool.errors * /

: error: The tag combination "tagName" for "xxx.imageset/xxx@3x.png" has no output specification. :错误:“ xxx.imageset/xxx@3x.png”的标签组合“ tagName”没有输出规范。

I had a look at actool man page and there's an option: 我看了一下actool手册页 ,有一个选择:

--asset-pack-output-specifications filename

Which says: 其中说:

Tells actool where to write the information about ODR resources found in the asset catalog. 告诉actool将在资产目录中找到的有关ODR资源的信息写入何处。 The emitted file will be a plist. 发出的文件将是一个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. 但是我不太确定将什么作为参数输入/使用此plist的位置,即使此选项在修复错误的正确轨道上也是如此。

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. 我将构建日志与同事的构建日志进行了比较,发现我拥有--asset-pack-output-specifications标志以及文件名,而即使我们的所有生产代码都相同,它们也没有。 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. 不知道为什么,但是有关擦除项目和所有相关目录以及从本地计算机完全构建自身的某些事情触发了启用--asset-pack-output-specification标志的功能。

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. 我可以通过删除按需资源标签并再次对其进行标记来解决该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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