unomed-dev / react-native-matrix-sdk

Matrix client SDK for React Native
Apache License 2.0
4 stars 0 forks source link

Doesn't build for simulator due to Xcode choking on fat library #1

Open Johennes opened 3 months ago

Johennes commented 3 months ago

I initially hit the following error when running pod install in the example app

❌  /Users/jm/Library/Developer/Xcode/DerivedData/MatrixSdkExample-ehaqmpwzfrmmtdcmzfodmqxnxfvn/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/react-native-matrix-sdk/Headers/module.modulemap:3:8: redefinition of module 'matrix_sdkFFI'

module matrix_sdkFFI {
            ^~~~~

❌  /Users/jm/Library/Developer/Xcode/DerivedData/MatrixSdkExample-ehaqmpwzfrmmtdcmzfodmqxnxfvn/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/react-native-matrix-sdk/Headers/module.modulemap:10:8: redefinition of module 'matrix_sdk_cryptoFFI'

module matrix_sdk_cryptoFFI {
       ^

❌  /Users/jm/Library/Developer/Xcode/DerivedData/MatrixSdkExample-ehaqmpwzfrmmtdcmzfodmqxnxfvn/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/react-native-matrix-sdk/Headers/module.modulemap:17:8: redefinition of module 'matrix_sdk_ffiFFI'

module matrix_sdk_ffiFFI {
       ^

❌  /Users/jm/Library/Developer/Xcode/DerivedData/MatrixSdkExample-ehaqmpwzfrmmtdcmzfodmqxnxfvn/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/react-native-matrix-sdk/Headers/module.modulemap:24:8: redefinition of module 'matrix_sdk_baseFFI'

module matrix_sdk_baseFFI {
       ^

❌  /Users/jm/Library/Developer/Xcode/DerivedData/MatrixSdkExample-ehaqmpwzfrmmtdcmzfodmqxnxfvn/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/react-native-matrix-sdk/Headers/module.modulemap:31:8: redefinition of module 'matrix_sdk_uiFFI'

module matrix_sdk_uiFFI {
       ^

This appears to have been caused by the library for the simulator platform being a fat one as the error disappeared once I excluded the x86_64 architecture.

Screenshot 2024-06-10 at 21 32 59

However, after unexcluding the architecture I'm now unable to reproduce the original error. This issue serves as record in case the issue reappears.

The following podspec setting might be an alternative to excluding architectures in Xcode:

s.pod_target_xcconfig = { 'ONLY_ACTIVE_ARCH' => 'YES' }