在xCode 6.4中成功构建项目后,在xCode 7 Beta 6中构建项目时出错

时间:2015-09-09 18:12:54

标签: ios xcode

我升级了IDE后输出了以下错误,尽管没有改变其他任何内容:

CompileAssetCatalog      /Users/suy/Library/Developer/Xcode/DerivedData/MyADT-enhkcdzrxjsfitcgsibsehlazpgg/Build/Products/Release-iphonesimulator/MyADT.app MyADT/Images.xcassets
cd /Users/suy/Desktop/self-service-mobile-ios
export   PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator. platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/actool --output-format human-readable-text --notices --warnings --export-dependency-info /Users/suy/Library/Developer/Xcode/DerivedData/MyADT-enhkcdzrxjsfitcgsibsehlazpgg/Build/Intermediates/MyADT.build/Release-iphonesimulator/MyADT.build/assetcatalog_dependencies.txt --output-partial-info-plist /Users/suy/Library/Developer/Xcode/DerivedData/MyADT-enhkcdzrxjsfitcgsibsehlazpgg/Build/Intermediates/MyADT.build/Release-iphonesimulator/MyADT.build/assetcatalog_generated_info.plist --app-icon AppIcon --launch-image LaunchImage --platform iphonesimulator --minimum-deployment-target 7.1 --target-device iphone --target-device ipad --compress-pngs --compile /Users/suy/Library/Developer/Xcode/DerivedData/MyADT-enhkcdzrxjsfitcgsibsehlazpgg/Build/Products/Release-iphonesimulator/MyADT.app /Users/suy/Desktop/self-service-mobile-ios/MyADT/Images.xcassets

2015-09-09 11:28:44.991 IBCocoaTouchImageCatalogTool[25293:921614] *** Terminating app due to uncaught exception 'IBAssertionFailure', reason: 'ASSERTION FAILURE:
Reason:     code which should be unreachable has been reached
File:       /SourceCache/IBAutolayoutFoundationIOS/IDEInterfaceBuilder-7706/Foundation/ImageCatalog/Compiler/IBICCoreThemeDocument.m:349 
Method:     -[IBICCoreThemeDocument coreUIResizingModeForResizingBehavior:]'
...
...
libc++abi.dylib: terminating with uncaught exception of type NSException
Command /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/actool failed with exit code 255

2 个答案:

答案 0 :(得分:1)

您的问题确实是由于在xCode 7中更改了xcassets的格式。但是,通过删除块,您将丢失图像拉伸行为设置。

相反,您可以通过将"cap-insets"更改为"capInsets"并将"mode" : "tile"更改为"mode" : "fill"

来解决此问题

以下是您案例的结果字符串:

{
  "images": [
    {
      "idiom": "universal",
      "filename": "login_show_button.png",
      "scale": "1x"
    },
    {
      "resizing": {
        "mode": "9-part",
        "center": {
          "mode": "tile",
          "width": 4,
          "height": 3
        },
        "cap-insets": {
          "bottom": 5,
          "top": 6,
          "right": 7,
          "left": 9
        }
      },
      "idiom": "universal",
      "filename": "login_show_button@2x.png",
      "scale": "2x"
    },
    {
      "idiom": "universal",
      "scale": "3x"
    }
  ],
  "info": {
    "version": 1,
    "author": "xcode"
  }
}

答案 1 :(得分:0)

经过一番挖掘后,我发现了Images.xcassets文件夹的问题。任何Contents.json文件都有一个Xcode 7 beta 6添加的块。

{
  "images" : [
    {
  "idiom" : "universal",
  "filename" : "login_show_button.png",
  "scale" : "1x"
},
{
  "resizing" : {
    "mode" : "9-part",
    "center" : {
      "mode" : "tile",
      "width" : 4,
      "height" : 3
    },
    "cap-insets" : {
      "bottom" : 5,
      "top" : 6,
      "right" : 7,
      "left" : 9
    }
  },
  "idiom" : "universal",
  "filename" : "login_show_button@2x.png",
  "scale" : "2x"
},
{
  "idiom" : "universal",
  "scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

我能够删除“resizing”和“cap-insets”块,直到“成语”声明。对所有Contents.json文件执行此操作允许我成功构建。