use_frameworks! and Model not found build error

时间:2016-04-15 14:58:56

标签: ios objective-c swift fastlane

I'm working on a rather large iOS project that was originally written in Objective-C and we're now starting to add in Swift code. We are using Cocoapods to install 3rd party libraries and have included use_frameworks! in our Podfile.

In some of our Objective-C classes, we have added module imports at the top such as @import AFNetworking;

Usually, on first build of the project within Xcode, the build fails and we see module 'AFNetworking' not found but on the second build, it works fine. However, now I am trying to get Fastlane to do our builds and when using Fastlane to do the builds, we get the error 100% of the time.

In the build settings of the target:

  • Enable Modules (C and Objective-C) is set to Yes
  • Always Search User Paths is set to No
  • User Header Search Paths is set to $(SRCROOT)/Pods and is recursive

Any suggestions on what else I can check/try?

2 个答案:

答案 0 :(得分:0)

您是否尝试过检查“其他链接标记”以查看其中是否包含-ObjC值?

您可以在导航器上单击项目名称,转到“构建设置”,向下滚动到“链接”部分,然后仔细检查“其他链接器标志”。如果不存在,您可以手动添加。

enter image description here

答案 1 :(得分:0)

今天我终于找到了问题的解决方案。我们的项目由多个目标(10+)组成,我们注意到只有一个目标无法构建。经过几个小时的狩猎,比较文件,我们最终查看了方案,并注意到无效的目标是使用Find Implicit Dependencies取消选中的方案。我们检查过这个,它又开始重建了!

请注意,如果我们在构建其中一个目标之后构建它,但是如果您随后删除了派生数据并尝试构建目标,那么目标就会构建,那么它就会失败。