今天下午在消除项目各类警告的时候,发现了下面这类警告:
Asset Catalog Compiler Warning Group
其中,有一类警告是这样的:Xcode把它叫做Ambiguous Content
描述:The app icon set “AppIcon” has an unassigned child.
有图有证据:
解决方案:
点击警告,在AppIcon预览里拉到底部,发现多了一个未赋值的子项,将其选中删除即可。
还有一类警告是这样的:Xcode把它叫做Missing Content
描述:
The file “Default.png” for the image set “LaunchImage” does not exist.
The file “[email protected]” for the image set “LaunchImage” does not exist.
The file “[email protected]” for the image set “LaunchImage” does not exist.
有图有证据:
(根据这类警告的名称Missing Content,很明显是对应的文件内容缺失了)
解决方案:
1、右键单击警告项,“Show in Finder”跳转至本机目录下的资源文件中。
2、选中并打开Contents.json,寻找缺失的图片资源名称,并将其对应的内容删除,保存当前文件。
3、重新编译,警告消除。