更新到XCode 8.3.1:带有Snapkit错误的Apple Mach-O链接器错误组

时间:2017-04-18 16:34:28

标签: xcode snapkit

刚刚更新到Xcode 8.3.1并构建我的项目得到如下错误:

 "__TFE7SnapKitPS_23ConstraintAttributesDSLg6heightCS_14ConstraintItem", referenced from:

  "__TFE7SnapKitPS_23ConstraintAttributesDSLg5widthCS_14ConstraintItem", referenced from:

  "__TFE7SnapKitPS_23ConstraintAttributesDSLg6centerCS_14ConstraintItem", referenced from:

  "__TFE7SnapKitPS_23ConstraintAttributesDSLg7centerXCS_14ConstraintItem", referenced from:

  "__TFE7SnapKitPS_23ConstraintAttributesDSLg6bottomCS_14ConstraintItem", referenced from:

  "__TFE7SnapKitPS_23ConstraintAttributesDSLg7leadingCS_14ConstraintItem", referenced from:

  "__TFE7SnapKitPS_23ConstraintAttributesDSLg7centerYCS_14ConstraintItem", referenced from:

  "__TFE7SnapKitPS_23ConstraintAttributesDSLg8trailingCS_14ConstraintItem", referenced from:

  "__TFE7SnapKitPS_23ConstraintAttributesDSLg3topCS_14ConstraintItem", referenced from:

clang: error: linker command failed with exit code 1 (use -v to see invocation)

似乎是SnapKit问题。

  • 尝试cmd + shift + k
  • 已删除pod 'SnapKit' pod install并将其添加回来仍无效。

如果不是版本问题。如何调试/解决这类错误。感谢。

修改 右键单击项目导航器中的错误,然后选择显示日志显示更多错误信息:

Undefined symbols for architecture x86_64:
  "__TFE7SnapKitPS_23ConstraintAttributesDSLg6heightCS_14ConstraintItem", referenced from:
      __TFFC6Auroma22AURAlarmViewController19configureBottomViewFCSo6UIViewT_U2_FC7SnapKit15ConstraintMakerT_ in AlarmViewController.o

我可以看到AlarmViewController称为SnapKit布局方法。但仍然不清楚为什么会出现错误。

修改 我以前的Xcode应该是8.3。

1 个答案:

答案 0 :(得分:2)

最后通过删除~/Library/Developer/Xcode/DerivedData来解决。