MadProgrammer
MadProgrammer

Reputation: 347324

Carthage dependent project targeted to iOS 10 fails to build, but when targeted to iOS 11 succeeds

I have a Swift based Cocoa Framework library which is using a module.modulemap to support a C based library (PortSIPLib). The project builds fine in Xcode.

I use the framework in another project through the use of Carthage, which is targeting iOS 10.

When Carthage builds the framework (carthage update --platform ios) it fails with

ld: warning: ignoring file /Users/.../Carthage/Checkouts/wesipkit/PortSIPLib/PortSIPLib.framework/PortSIPLib, missing required architecture i386 in file /Users/.../Carthage/Checkouts/wesipkit/PortSIPLib/PortSIPLib.framework/PortSIPLib (3 slices)
Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_PortSIPSDK", referenced from:
      objc-class-ref in SIPServiceProvider.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

But if I target both the project and framework to use iOS 11, Carthage builds successfully?

I've tried using both the debug and release configuration settings, both fail

Is there a different approach I can take? Are there other settings I should be configuring?

Is there anyway I can tell Carthage/Xcode to ignore trying to build for the simulator? I don't need to run it in the simulator

The issue isn't the fact that the (PortSIPLib) is missing a i386 implementation, the issue is why does it work when targeting iOS 11 but not iOS 10?

I've literally spent a week trying to diagnose this issue, going so far as re-creating the framework project and it was only just now I realised the issue was with the iOS target level

Xcode version 9.1 beta (9B46)

Framework module.modulemap for PortSIPLib

module PortSIPLib {
    umbrella header "PortSIPLib.framework/Headers/PortSIPSDK.h"
    header "PortSIPLib.framework/Headers/PortSIPErrors.hxx"
    header "PortSIPLib.framework/Headers/PortSIPEventDelegate.h"
    header "PortSIPLib.framework/Headers/PortSIPTypes.hxx"
    header "PortSIPLib.framework/Headers/PortSIPVideoRenderView.h"

    export *
    module * { export * }
}

This is stored in $(SRCROOT)/PortSIPLib along with the PortSIPLib framework

Upvotes: 1

Views: 416

Answers (0)

Related Questions