将Xcode升级到6.3后,在故事板上编译错误

时间:2015-04-11 01:20:38

标签: storyboard xcode6.3 ibtool

在将Xcode升级到6.3之后,故事板文件以前是使用Xcode6.0创建的。编译错误会突然显示错误的错误消息。我花了好几个小时进行搜索,但仍然无法弄清楚故事板文件中有问题的项目究竟在哪里/哪里。

提前感谢您的时间/建议等。

以下是完整的错误消息:

    nwi_state: registration failed (1000000)
    2015-04-11 09:01:43.783 Interface Builder Cocoa Touch Tool[11220:234260] ***storageTaskManagerExistsWithIdentifier:withIdentifier failed: Error Domain=NSCocoaErrorDomain Code=4099 "The operation couldn’t be completed. (Cocoa error 4099.)" (The connection to service named com.apple.nsurlstorage-cache was invalidated.) UserInfo=0x7ffb92e2b7b0 {NSDebugDescription=The connection to service named com.apple.nsurlstorage-cache was invalidated.};
    {NSDebugDescription = "The connection to service named com.apple.nsurlstorage-cache was invalidated.";}
    nwi_state: registration failed (1000000)
    2015-04-11 09:01:55.387 Interface Builder Cocoa Touch Tool[11225:234925] ***storageTaskManagerExistsWithIdentifier:withIdentifier failed: Error Domain=NSCocoaErrorDomain Code=4099 "The operation couldn’t be completed. (Cocoa error 4099.)" (The connection to service named com.apple.nsurlstorage-cache was invalidated.) UserInfo=0x7fac79702450 {NSDebugDescription=The connection to service named com.apple.nsurlstorage-cache was invalidated.}; {
NSDebugDescription = "The connection to service named com.apple.nsurlstorage-cache was invalidated.";}
    2015-04-11 09:02:06.649 ibtoold[11212:234105] [MT] DVTAssertions: ASSERTION FAILURE in /SourceCache/IDEInterfaceBuilder/IDEInterfaceBuilder-7531/InterfaceBuilderKit/Utilities/IBAbstractMessageChannelInterfaceBuilderToolProxy.m:38
    Details:  Failed to compile nib consisting of IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBLayoutConstraint, IBProxyObject, IBProxyObject, IBUIImageView, IBUILabel, IBUILabel, IBUITableViewCell, IBUITableViewCellContentView, and IBUITextView.

    Encountered an error communicating with Interface Builder Cocoa Touch Tool. If you choose to file a crash report or Radar for this issue, please check Console.app for crash reports for "Interface Builder Cocoa Touch Tool" and include their content in your crash report.

    Exception name: NSInvalidArgumentException
    Exception reason: *** +[NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:]: A multiplier of 0 or a nil second item together with a location for the first attribute creates an illegal constraint of a location equal to a constant. Location attributes must be specified in pairs
    Exception backtrace:
      0. CoreFoundation           0x000000010b92fc4d __exceptionPreprocess
      1. libobjc.A.dylib          0x000000010a6cebb7 objc_exception_throw
      2. CoreFoundation           0x000000010b92fb9d +
      3. Foundation               0x000000010a3f7233 VerifyConstraintArguments
      4. Foundation               0x000000010a260a5a +
      5. IBAutolayoutFoundation   0x0000000109ddaebc -
      6. IBCocoaTouchToolFoundation 0x00000001081fb977 -
      7. IBCocoaTouchToolFoundation 0x000000010821713b -
      8. IBCocoaTouchToolFoundation 0x00000001081f18b8 -
      9. IBFoundation             0x0000000109efe549 __80-[IBMessageReceiveChannel deliverMessage:toTarget:withArguments:context:result:]_block_invoke
     10. IBFoundation             0x0000000109efe2a6 -
     11. IBFoundation             0x0000000109efdf90 __88-[IBMessageReceiveChannel runBlockingReceiveLoopNotifyingQueue:notifyingTarget:context:]_block_invoke
     12. libdispatch.dylib        0x000000010eeec964 _dispatch_client_callout
     13. libdispatch.dylib        0x000000010eed9818 _dispatch_barrier_sync_f_slow_invoke
     14. libdispatch.dylib        0x000000010eeec964 _dispatch_client_callout
     15. libdispatch.dylib        0x000000010eed7a59 _dispatch_main_queue_callback_4CF
     16. CoreFoundation           0x000000010b8971f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
     17. CoreFoundation           0x000000010b858dcb __CFRunLoopRun
     18. CoreFoundation           0x000000010b858366 CFRunLoopRunSpecific
     19. Foundation               0x000000010a284f92 -
     20. IBFoundation             0x0000000109edcc20 -
     21. IBFoundation             0x0000000109edcdaf -
     22. IBFoundation             0x0000000109edd072 +
     23. ???                      0x0000000108177be7 ???
     24. libdyld.dylib            0x000000010ef1c145 start
    Exception info:{
    }

    Function: __IBAssertMarshallingFailureWithUniqueBacktrace_block_invoke
    Thread:   <NSThread: 0x7fc88b104020>{number = 1, name = main}
    Hints: None
    Backtrace:
      0  0x0000000104b3f4a1 -[DVTAssertionHandler handleFailureInFunction:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in DVTFoundation)
      1  0x0000000104b3ec3b _DVTAssertionHandler (in DVTFoundation)
      2  0x0000000104b3ee9e _DVTAssertionFailureHandler (in DVTFoundation)
      3  0x0000000105a685e8 __IBAssertMarshallingFailureWithUniqueBacktrace_block_invoke (in IDEInterfaceBuilderKit)
      4  0x0000000105a68407 IBAssertMarshallingFailureWithUniqueBacktrace (in IDEInterfaceBuilderKit)
      5  0x0000000105a6825e IBAssertMarshallingFailure (in IDEInterfaceBuilderKit)
      6  0x000000010cd2f89a (in IDEInterfaceBuilderCocoaTouchIntegration)
      7  0x000000010cd303c9 (in IDEInterfaceBuilderCocoaTouchIntegration)
      8  0x0000000105a0757c -[IBDocumentCompiler invokeWhileUsingSourceAsIntermediateDocument:] (in IDEInterfaceBuilderKit)
      9  0x0000000105a0788d -[IBDocumentCompiler invokeWithIntermediateDocumentOfTargetRuntime:alwaysCopy:block:] (in IDEInterfaceBuilderKit)
     10  0x000000010cd2fc97 (in IDEInterfaceBuilderCocoaTouchIntegration)
     11  0x000000010cd1e0e2 (in IDEInterfaceBuilderCocoaTouchIntegration)
     12  0x0000000105c19cd4 -[IBStoryboardSceneCompilationGroup compilationResultsForCompilationUnits:options:returningErrors:] (in IDEInterfaceBuilderKit)
     13  0x0000000105c0aa9a -[IBStoryboardDocumentCompiler compileUnitsFromCompilationGroups:filter:options:errors:] (in IDEInterfaceBuilderKit)
     14  0x0000000105c0bd73 __78-[IBStoryboardDocumentCompiler compileContentsOfStoryboardWithOptions:errors:]_block_invoke (in IDEInterfaceBuilderKit)
     15  0x0000000105ae5f46 IBWithAutoInvalidationPool (in IDEInterfaceBuilderKit)
     16  0x0000000105c0bb15 -[IBStoryboardDocumentCompiler compileContentsOfStoryboardWithOptions:errors:] (in IDEInterfaceBuilderKit)
     17  0x0000000105c0c116 -[IBStoryboardDocumentCompiler internalCompileWithOptions:error:] (in IDEInterfaceBuilderKit)
     18  0x000000010cd1e2f4 (in IDEInterfaceBuilderCocoaTouchIntegration)
     19  0x0000000105c0ca56 __57-[IBStoryboardDocumentCompiler compileWithOptions:error:]_block_invoke (in IDEInterfaceBuilderKit)
     20  0x0000000105a07699 -[IBDocumentCompiler invokeWithIntermediateDocument:] (in IDEInterfaceBuilderKit)
     21  0x0000000105a0783d -[IBDocumentCompiler invokeWithIntermediateDocumentOfTargetRuntime:alwaysCopy:block:] (in IDEInterfaceBuilderKit)
     22  0x0000000105c0c6fc -[IBStoryboardDocumentCompiler compileWithOptions:error:] (in IDEInterfaceBuilderKit)
     23  0x0000000105a07a27 +[IBDocumentCompiler compileContentsOfDocument:options:error:] (in IDEInterfaceBuilderKit)
     24  0x00000001059c2640 __47-[IBDocument compiledPackageWithOptions:error:]_block_invoke (in IDEInterfaceBuilderKit)
     25  0x00000001059fafd5 -[IBDocumentAutolayoutManager assertIfArbitrationIsScheduledDuring:] (in IDEInterfaceBuilderKit)
     26  0x00000001059c2597 -[IBDocument compiledPackageWithOptions:error:] (in IDEInterfaceBuilderKit)
     27  0x0000000104947f0a (in ibtoold)
     28  0x0000000104944b40 (in ibtoold)
     29  0x0000000104947370 (in ibtoold)
     30  0x000000010494d233 (in ibtoold)
     31  0x000000010494d7b0 (in ibtoold)
     32  0x000000010494d683 (in ibtoold)
     33  0x000000010493c60a (in ibtoold)
     34  0x000000010494ce2c (in ibtoold)
     35  0x000000010494c074 (in ibtoold)
     36  0x00007fff8a78b5c9 start (in libdyld.dylib)
     37  0x0000000000000002
    Command /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ibtool failed with exit code 

3 个答案:

答案 0 :(得分:0)

最后用可行(尽管效率不高)的方法解决了问题:

缩小范围,从而通过以“二分搜索”方式从故事板中删除其他视图场景来定位有问题的视图场景。

在确定了有问题的视图后,我重新设置了视图及其约束。然后,Build Succeeded。

在此分享,因为它可能对其他人有用。

答案 1 :(得分:0)

如果您尝试向不在视图层次结构中的视图添加约束,则会发生这种情况。自动布局限制。

我继续使用Xcode 6.3并执行以下操作:

我找出了哪个以编程方式创建的约束导致了问题(通过在调试中运行代码并查看崩溃发生的时间)。然后我调试到这一点并且在添加约束时检查约束内的2个视图都不为null。其中一个是。我解决了这个错误。

答案 2 :(得分:0)

这就是我解决问题的方法:我将故事板文件复制到我的Windows机器上并用Linq写了一个小的C#程序到XML来查找伪造的约束,它具有“firstItem”属性但缺少“secondItem”属性。基本上它只是一行:

        var nosecondCons = xdoc.Descendants("constraint").Where(p => p.Attribute("secondItem") == null && p.Attribute("firstItem") != null);