iOS 14, build issue when Framework is integrated - x86_64 simulator

873 Views Asked by At

In iOS Framework project, we have Obj C and Swift code, we build a .framework and distribute through our code repo for other app projects to integrate.

The build we generate is an universal framework, so that it works on device as well as simulator.

Recently in Xcode 12 iOS 14, the build generation failed as we use lipo to combine the frameworks for simulator and device architectures as shown here iOS 14, lipo error while creating library for both device and simulator, as suggested in the answer, excluded the arm64 arch from simulator build then the lipo cmd worked and Framework got built, following is the build command(s) we use

simulator:
MySDK -target MySDK ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" OBJROOT="${OBJROOT}/DependentBuilds" EXCLUDED_ARCHS="arm64"

device:
MySDK -target MySDK ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" OBJROOT="${OBJROOT}/DependentBuilds"

Now when this .framework is integrated with other app project(MyProject) using cocoapods. Upon building the project with below command gives following errors

xcodebuild install -scheme MyProject -workspace MyProject.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 8'

Errors

** INSTALL FAILED **

The following build commands failed:
    CompileSwift normal x86_64
    CompileSwift normal x86_64
    CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
    CompileSwift normal x86_64

/Users/path/to/MyProject/Pods/MySDK/MySDK.framework/Modules/MySDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:21:96: error: 'someStruct' is not a member type of 'MySDK'
  @objc public func someMethod(some: args) -> Swift.void)

Note: The project with MySDK(Framework) integrated works fine we run on a device or simulator through Xcode, but when the above command is run it is giving these errors

0

There are 0 best solutions below