Skip to content

OS build fails on Xcode 16.4/16.5 (Swift 6.2) — ComplyCubeMobileSDK compiled with Swift 6.1 & Unable to find module dependency: 'Segment' #7

@ievitchenko

Description

@ievitchenko

On iOS the project fails to compile with Xcode 16.4/16.5 (Swift 6.2) with React Native 0.81.0.
The prebuilt ComplyCubeMobileSDK.xcframework is compiled with Swift 6.1, so the Swift module is not accepted by the 6.2 compiler.

Android builds & runs fine (but only after patching the RN package - adding fix in ComplyCubeModule.kt - the module fails when relying on currentActivity in some RN setups.

Unresolved reference 'currentActivity'
None of the following candidates is applicable: constructor Intent(...)
Unresolved reference 'startActivity'

Applied fix is to start the SDK activity via the application context and FLAG_ACTIVITY_NEW_TASK).

Error

/node_modules/@complycube/react-native/ios/CCView.swift:2:8
Failed to build module 'ComplyCubeMobileSDK';
this SDK is not supported by the compiler
(the SDK is built with 'Apple Swift version 6.1 effective-5.10 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)',
while this compiler is 'Apple Swift version 6.2 effective-5.10 (swiftlang-6.2.0.19.9 clang-1700.3.19.1)').
Please select a toolchain which matches the SDK.

Environment

Xcode: 16.4 / 16.5 (Swift 6.2)

macOS: 15

React Native: 0.81.0

@complycube/react-native: 1.1.5

ComplyCubeMobileSDK: 1.3.12 (pulled by the RN package)

iOS Deployment Target: 15.1

CocoaPods: 1.15.2

Minimal repro steps

npx react-native init Test --version 0.81.0

npm i @complycube/react-native@1.1.5

Complete steps from Mobile SDK integration guide or try to use settings from example repo

cd ios && pod install --repo-update

Open Test.xcworkspace in Xcode 16.4/16.5, build the iOS app → see error above.

Note: If SWIFT_ENABLE_EXPLICIT_MODULES=NO is set for complycube-react-native / ComplyCubeMobileSDK pods, the build can proceed a bit further, but it still fails on the Swift 6.1 vs 6.2 mismatch when the module is validated.

What I tried / Workarounds

Matching the example project setup (use_frameworks! :linkage => :static, RN pods, CocoaPods 1.15.x).

Disabling Explicit Module Builds only for ComplyCube pods:

SWIFT_ENABLE_EXPLICIT_MODULES = NO
SWIFT_COMPILATION_MODE = wholemodule
SWIFT_USE_INTEGRATED_DRIVER = NO

Full clean of DerivedData/Pods, repo update, etc.

These tweaks can avoid earlier module-graph errors (like Unable to find module dependency: 'Segment'), but they do not fix the fundamental 6.1 vs 6.2 toolchain incompatibility of the prebuilt xcframework.

Can you please provide a temporary/recommended configuration/workaround to build successfully on Xcode 16.4/16.5 (Swift 6.2) and React Native 0.81.0?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions