【问题标题】:Asset Catalog Compiling (actool) fails in Xcode 11.4Xcode 11.4 中的资产目录编译 (actool) 失败
【发布时间】:2020-03-31 13:51:15
【问题描述】:

编译纹理集设置为data 的资产目录时遇到此错误。

Assertion failed: (maxCountIncludingZeroTerminator > 0 && tokenCount < maxCountIncludingZeroTerminator), function CUIRenditionKeyCopy, file /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/CoreUI/CoreUI-609.4/CoreTheme/ThemeStorage/CUIThemeRendition_Support.m, line 849.
Command CompileAssetCatalog failed with a nonzero exit code

这个项目非常简单:https://drive.google.com/file/d/1zyt5_0MV2BYfb4H2aLGbRO3L-eC3a4to/view?usp=sharing

该项目实际上是一个空的 macOS 项目,其资产目录具有单个纹理集和单个纹理。

将解释设置为color 可以解决此问题,但这不是很有用。将目标更改为 10.14 也可以,但在其他地方会出错。

这是资产目录树

Textures.xcassets
├── Contents.json
└── Texture.textureset
    ├── Contents.json
    └── Universal.mipmapset
        ├── Contents.json
        └── chest-color.png
Textures.xcassets/Content.json
{  
  "info" : {  
    "author" : "xcode",  
    "version" : 1  
  }  
}
Textures.xcassets/Texture.textureset/Content.json
{  
  "info" : {  
  "author" : "xcode",  
  "version" : 1  
  },  
  "properties" : {  
  "interpretation" : "data"  
  },  
  "textures" : [  
  {  
  "filename" : "Universal.mipmapset",  
  "idiom" : "universal"  
  }  
  ]  
}  
Textures.xcassets/Texture.textureset/Universal.mipmapset/Contents.json
{
  "info" : {
    "author" : "xcode",
    "version" : 1
  },
  "levels" : [
    {
      "filename" : "chest-color.png",
      "mipmap-level" : "base"
    }
  ]
}

更新:看起来可能是工具问题?就像我提到的设置为 10.14 会导致资产目录构建?

更新 1:使用 Apple #FB7647328 创建的票证

【问题讨论】:

  • 最后一个 JSON 片段是什么?
  • @trojanfoe 更新了问题,该 blob 是纹理集​​中的 Universal.mipmapset/Content.json
  • 仅供参考,我也看到了同样的情况。最初,当我安装 11.4 时,我的项目仍然构建,但昨天突然开始发生此错误,即使对于一个目录为空的全新项目也是如此!甚至尝试重新安装 Xcode,但没有成功。
  • 不管怎样,安装新的 Xcode 11.4.1 更新为我解决了这个问题(安装后,我做了另一个项目 build clean 并从库中删除了 iOS DeviceSupportDerivedData 中的所有内容/Developer/Xcode,只是为了确定)。真的希望此更新也能为您修复它;是一个非常令人沮丧的问题!
  • @TheNeil 现在 Xcode 11.4.1 已解决此问题

标签: swift xcode macos asset-catalog


【解决方案1】:

从 Xcode v11.4.1 开始,此问题已针对面向 10.15 的 MacOS 应用程序修复。

编辑: 安装 Xcode 11.4.1 后,您可能需要删除以下文件夹中的文件/文件夹并重新启动 Xcode:

~/Library/Developer/Xcode/DerivedData/

还有可能:

~/Library/Developer/Xcode/iOS DeviceSupport/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-09-14
    • 1970-01-01
    • 1970-01-01
    • 2018-04-06
    • 2012-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多