Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create a library exposing a Turbo Module with Swift code (0.77+) #49104

Closed
mgcrea opened this issue Jan 31, 2025 · 6 comments
Closed

Cannot create a library exposing a Turbo Module with Swift code (0.77+) #49104

mgcrea opened this issue Jan 31, 2025 · 6 comments
Labels
Needs: Triage 🔍 Resolution: Answered When the issue is resolved with a simple answer Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@mgcrea
Copy link

mgcrea commented Jan 31, 2025

Description

I have been trying to find the proper podspec configuration to build a "library" that exposes a basic turbo module with a swift implementation, by "library" I mean a module that would end up as a dependency of an RN project.

Everything works fine without swift as you can check in the main branch of this repository.

Unfortunately I can't build anymore after adding/using a Swift file. Compiling mixed cpp/swift code seems complicated, and it looks like I'm hitting this issue

However since using a local turbo module setup does work with swift (as long as you revert the AppDelegate to .mm/.h), I guess (hope!) that there is be a .podspec config that would build correctly. You can check the working "local" setup in this repository

I have tried to remove the headers from s.source_files as told in this issue but never managed to make it work.

Would be great if we had some basic working example for using Swift with RN in these common library-like setups where the package is expected to be added as a dep.

Steps to reproduce

  1. Clone the swift branch of this repository: https://github.com/mgcrea/react-native-turbo-module-library-example/tree/swift
  2. corepack install
  3. pnpm install
  4. cd example
  5. bundle install
  6. npm run install:ios
  7. npm run open:ios
  8. Attempt to build with Xcode

Can't really use the reproducer to easily replicate this "library" setup.

React Native Version

0.77.0

Affected Platforms

Runtime - iOS, Build - MacOS

Areas

TurboModule - The New Native Module System

Output of npx react-native info

info Fetching system and libraries information...
System:
  OS: macOS 15.2
  CPU: (10) arm64 Apple M1 Max
  Memory: 215.88 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.12.0
    path: /opt/homebrew/opt/node@22/bin/node
  Yarn: Not Found
  npm:
    version: 10.9.0
    path: /opt/homebrew/opt/node@22/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10227.8.2321.11479570
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.77.0
    wanted: 0.77.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

Build target NativeLocalStorage of project Pods with configuration Debug

SwiftCompile normal arm64 Compiling\ NativeLocalStorage.swift X/ios/NativeLocalStorage.swift (in target 'NativeLocalStorage' from project 'Pods')
    cd X/example/ios/Pods
    builtin-swiftTaskExecution -- /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c X/ios/NativeLocalStorage.swift -emit-module-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage.swiftmodule -emit-module-doc-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage.swiftdoc -emit-module-source-info-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage.swiftsourceinfo -emit-dependencies-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage-master.d -emit-const-values-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage-master.swiftconstvalues -serialize-diagnostics-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage-master.dia -emit-objc-header-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage-Swift.h -emit-abi-descriptor-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage.abi.json -target arm64-apple-ios15.1-simulator -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk -I /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Products/Debug-iphonesimulator/NativeLocalStorage -F /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Products/Debug-iphonesimulator/NativeLocalStorage -F X/example/ios/Pods/hermes-engine/destroot/Library/Frameworks/universal -F /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/hermes-engine/Pre-built -no-color-diagnostics -enable-testing -g -debug-info-format\=dwarf -dwarf-version\=4 -import-underlying-module -module-cache-path /Users/olivier/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity\=checked -Onone -D DEBUG -D COCOAPODS -D RCT_NEW_ARCH_ENABLED -serialize-debugging-options -const-gather-protocols-file /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage_const_extract_protocols.json -enable-experimental-feature DebugDescriptionMacro -enable-experimental-feature OpaqueTypeErasure -enable-bare-slash-regex -empty-abi-descriptor -validate-clang-modules-once -clang-build-session-file /Users/olivier/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -Xcc -working-directory -Xcc X/example/ios/Pods -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -file-compilation-dir X/example/ios/Pods -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/RCTDeprecation/RCTDeprecation.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/RCTFabric/React-RCTFabric.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/React/React-Core.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/ReactCodegen/ReactCodegen.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/ReactCommon/ReactCommon.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/React_Fabric/React-Fabric.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/React_FabricComponents/React-FabricComponents.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/React_NativeModulesApple/React-NativeModulesApple.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/React_RCTAppDelegate/React-RCTAppDelegate.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/folly/RCT-Folly.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/glog/glog.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/jsi/React-jsi.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/jsinspector_modern/React-jsinspector.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_debug/React-debug.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_featureflags/React-featureflags.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_nativemodule_defaults/React-defaultsnativemodule.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_nativemodule_dom/React-domnativemodule.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_nativemodule_featureflags/React-featureflagsnativemodule.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_nativemodule_idlecallbacks/React-idlecallbacksnativemodule.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_nativemodule_microtasks/React-microtasksnativemodule.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_renderer_debug/React-rendererdebug.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_renderer_graphics/React-graphics.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_renderer_imagemanager/React-ImageManager.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_utils/React-utils.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/yoga/Yoga.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/NativeLocalStorage/NativeLocalStorage.modulemap -Xcc -D_LIBCPP_HARDENING_MODE\=_LIBCPP_HARDENING_MODE_DEBUG -Xcc -ivfsstatcache -Xcc /Users/olivier/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator18.2-22C146-07b28473f605e47e75261259d3ef3b5a.sdkstatcache -Xcc -I/Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/NativeLocalStorage-generated-files.hmap -Xcc -I/Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/NativeLocalStorage-own-target-headers.hmap -Xcc -I/Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/NativeLocalStorage-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Pods-8699adb1dd336b26511df848a716bd42-VFS-iphonesimulator/all-product-headers.yaml -Xcc -iquote -Xcc /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/NativeLocalStorage-project-headers.hmap -Xcc -I/Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Products/Debug-iphonesimulator/NativeLocalStorage/include -Xcc -IX/example/ios/Pods/Headers/Public -Xcc -IX/example/ios/Pods/Headers/Public/DoubleConversion -Xcc -IX/example/ios/Pods/Headers/Public/FBLazyVector -Xcc -IX/example/ios/Pods/Headers/Public/RCT-Folly -Xcc -IX/example/ios/Pods/Headers/Public/RCTRequired -Xcc -IX/example/ios/Pods/Headers/Public/RCTTypeSafety -Xcc -IX/example/ios/Pods/Headers/Public/React-Core -Xcc -IX/example/ios/Pods/Headers/Public/React-Fabric -Xcc -IX/example/ios/Pods/Headers/Public/React-FabricComponents -Xcc -IX/example/ios/Pods/Headers/Public/React-FabricImage -Xcc -IX/example/ios/Pods/Headers/Public/React-ImageManager -Xcc -IX/example/ios/Pods/Headers/Public/React-Mapbuffer -Xcc -IX/example/ios/Pods/Headers/Public/React-NativeModulesApple -Xcc -IX/example/ios/Pods/Headers/Public/React-RCTBlob -Xcc -IX/example/ios/Pods/Headers/Public/React-RCTFBReactNativeSpec -Xcc -IX/example/ios/Pods/Headers/Public/React-RCTFabric -Xcc -IX/example/ios/Pods/Headers/Public/React-RCTText -Xcc -IX/example/ios/Pods/Headers/Public/React-RuntimeApple -Xcc -IX/example/ios/Pods/Headers/Public/React-RuntimeCore -Xcc -IX/example/ios/Pods/Headers/Public/React-RuntimeHermes -Xcc -IX/example/ios/Pods/Headers/Public/React-callinvoker -Xcc -IX/example/ios/Pods/Headers/Public/React-cxxreact -Xcc -IX/example/ios/Pods/Headers/Public/React-debug -Xcc -IX/example/ios/Pods/Headers/Public/React-defaultsnativemodule -Xcc -IX/example/ios/Pods/Headers/Public/React-domnativemodule -Xcc -IX/example/ios/Pods/Headers/Public/React-featureflags -Xcc -IX/example/ios/Pods/Headers/Public/React-featureflagsnativemodule -Xcc -IX/example/ios/Pods/Headers/Public/React-graphics -Xcc -IX/example/ios/Pods/Headers/Public/React-hermes -Xcc -IX/example/ios/Pods/Headers/Public/React-idlecallbacksnativemodule -Xcc -IX/example/ios/Pods/Headers/Public/React-jserrorhandler -Xcc -IX/example/ios/Pods/Headers/Public/React-jsi -Xcc -IX/example/ios/Pods/Headers/Public/React-jsiexecutor -Xcc -IX/example/ios/Pods/Headers/Public/React-jsinspector -Xcc -IX/example/ios/Pods/Headers/Public/React-logger -Xcc -IX/example/ios/Pods/Headers/Public/React-microtasksnativemodule -Xcc -IX/example/ios/Pods/Headers/Public/React-nativeconfig -Xcc -IX/example/ios/Pods/Headers/Public/React-perflogger -Xcc -IX/example/ios/Pods/Headers/Public/React-performancetimeline -Xcc -IX/example/ios/Pods/Headers/Public/React-rendererconsistency -Xcc -IX/example/ios/Pods/Headers/Public/React-rendererdebug -Xcc -IX/example/ios/Pods/Headers/Public/React-runtimeexecutor -Xcc -IX/example/ios/Pods/Headers/Public/React-runtimescheduler -Xcc -IX/example/ios/Pods/Headers/Public/React-timing -Xcc -IX/example/ios/Pods/Headers/Public/React-utils -Xcc -IX/example/ios/Pods/Headers/Public/ReactCodegen -Xcc -IX/example/ios/Pods/Headers/Public/ReactCommon -Xcc -IX/example/ios/Pods/Headers/Public/Yoga -Xcc -IX/example/ios/Pods/Headers/Public/boost -Xcc -IX/example/ios/Pods/Headers/Public/fast_float -Xcc -IX/example/ios/Pods/Headers/Public/fmt -Xcc -IX/example/ios/Pods/Headers/Public/glog -Xcc -IX/example/ios/Pods/Headers/Public/hermes-engine -Xcc -IX/example/ios/Pods/Headers/Public/NativeLocalStorage -Xcc -IX/example/ios/Pods/boost -Xcc -IX/example/ios/Pods/Headers/Private/Yoga -Xcc -I/Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/DerivedSources-normal/arm64 -Xcc -I/Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/DerivedSources/arm64 -Xcc -I/Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG\=1 -Xcc -DDEBUG\=1 -Xcc -DCOCOAPODS\=1 -module-name NativeLocalStorage -frontend-parseable-output -disable-clang-spi -target-sdk-version 18.2 -target-sdk-name iphonesimulator18.2 -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/swift/host/plugins\#/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/local/lib/swift/host/plugins\#/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/swift-plugin-server -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -parse-as-library -num-threads 10 -o /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage.o -index-unit-output-path /Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage.o -index-store-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Index.noindex/DataStore -index-system-modules

SwiftCompile normal arm64 X/ios/NativeLocalStorage.swift (in target 'NativeLocalStorage' from project 'Pods')
    cd X/example/ios/Pods
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -c X/ios/NativeLocalStorage.swift -emit-module-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage.swiftmodule -emit-module-doc-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage.swiftdoc -emit-module-source-info-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage.swiftsourceinfo -emit-dependencies-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage-master.d -emit-const-values-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage-master.swiftconstvalues -serialize-diagnostics-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage-master.dia -emit-objc-header-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage-Swift.h -emit-abi-descriptor-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage.abi.json -target arm64-apple-ios15.1-simulator -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk -I /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Products/Debug-iphonesimulator/NativeLocalStorage -F /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Products/Debug-iphonesimulator/NativeLocalStorage -F X/example/ios/Pods/hermes-engine/destroot/Library/Frameworks/universal -F /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/hermes-engine/Pre-built -no-color-diagnostics -enable-testing -g -debug-info-format\=dwarf -dwarf-version\=4 -import-underlying-module -module-cache-path /Users/olivier/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity\=checked -Onone -D DEBUG -D COCOAPODS -D RCT_NEW_ARCH_ENABLED -serialize-debugging-options -const-gather-protocols-file /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage_const_extract_protocols.json -enable-experimental-feature DebugDescriptionMacro -enable-experimental-feature OpaqueTypeErasure -enable-bare-slash-regex -empty-abi-descriptor -validate-clang-modules-once -clang-build-session-file /Users/olivier/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -Xcc -working-directory -Xcc X/example/ios/Pods -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -file-compilation-dir X/example/ios/Pods -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/RCTDeprecation/RCTDeprecation.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/RCTFabric/React-RCTFabric.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/React/React-Core.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/ReactCodegen/ReactCodegen.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/ReactCommon/ReactCommon.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/React_Fabric/React-Fabric.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/React_FabricComponents/React-FabricComponents.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/React_NativeModulesApple/React-NativeModulesApple.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/React_RCTAppDelegate/React-RCTAppDelegate.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/folly/RCT-Folly.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/glog/glog.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/jsi/React-jsi.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/jsinspector_modern/React-jsinspector.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_debug/React-debug.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_featureflags/React-featureflags.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_nativemodule_defaults/React-defaultsnativemodule.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_nativemodule_dom/React-domnativemodule.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_nativemodule_featureflags/React-featureflagsnativemodule.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_nativemodule_idlecallbacks/React-idlecallbacksnativemodule.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_nativemodule_microtasks/React-microtasksnativemodule.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_renderer_debug/React-rendererdebug.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_renderer_graphics/React-graphics.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_renderer_imagemanager/React-ImageManager.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/react_utils/React-utils.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/yoga/Yoga.modulemap -Xcc -fmodule-map-file\=X/example/ios/Pods/Headers/Public/NativeLocalStorage/NativeLocalStorage.modulemap -Xcc -D_LIBCPP_HARDENING_MODE\=_LIBCPP_HARDENING_MODE_DEBUG -Xcc -ivfsstatcache -Xcc /Users/olivier/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator18.2-22C146-07b28473f605e47e75261259d3ef3b5a.sdkstatcache -Xcc -I/Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/NativeLocalStorage-generated-files.hmap -Xcc -I/Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/NativeLocalStorage-own-target-headers.hmap -Xcc -I/Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/NativeLocalStorage-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Pods-8699adb1dd336b26511df848a716bd42-VFS-iphonesimulator/all-product-headers.yaml -Xcc -iquote -Xcc /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/NativeLocalStorage-project-headers.hmap -Xcc -I/Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Products/Debug-iphonesimulator/NativeLocalStorage/include -Xcc -IX/example/ios/Pods/Headers/Public -Xcc -IX/example/ios/Pods/Headers/Public/DoubleConversion -Xcc -IX/example/ios/Pods/Headers/Public/FBLazyVector -Xcc -IX/example/ios/Pods/Headers/Public/RCT-Folly -Xcc -IX/example/ios/Pods/Headers/Public/RCTRequired -Xcc -IX/example/ios/Pods/Headers/Public/RCTTypeSafety -Xcc -IX/example/ios/Pods/Headers/Public/React-Core -Xcc -IX/example/ios/Pods/Headers/Public/React-Fabric -Xcc -IX/example/ios/Pods/Headers/Public/React-FabricComponents -Xcc -IX/example/ios/Pods/Headers/Public/React-FabricImage -Xcc -IX/example/ios/Pods/Headers/Public/React-ImageManager -Xcc -IX/example/ios/Pods/Headers/Public/React-Mapbuffer -Xcc -IX/example/ios/Pods/Headers/Public/React-NativeModulesApple -Xcc -IX/example/ios/Pods/Headers/Public/React-RCTBlob -Xcc -IX/example/ios/Pods/Headers/Public/React-RCTFBReactNativeSpec -Xcc -IX/example/ios/Pods/Headers/Public/React-RCTFabric -Xcc -IX/example/ios/Pods/Headers/Public/React-RCTText -Xcc -IX/example/ios/Pods/Headers/Public/React-RuntimeApple -Xcc -IX/example/ios/Pods/Headers/Public/React-RuntimeCore -Xcc -IX/example/ios/Pods/Headers/Public/React-RuntimeHermes -Xcc -IX/example/ios/Pods/Headers/Public/React-callinvoker -Xcc -IX/example/ios/Pods/Headers/Public/React-cxxreact -Xcc -IX/example/ios/Pods/Headers/Public/React-debug -Xcc -IX/example/ios/Pods/Headers/Public/React-defaultsnativemodule -Xcc -IX/example/ios/Pods/Headers/Public/React-domnativemodule -Xcc -IX/example/ios/Pods/Headers/Public/React-featureflags -Xcc -IX/example/ios/Pods/Headers/Public/React-featureflagsnativemodule -Xcc -IX/example/ios/Pods/Headers/Public/React-graphics -Xcc -IX/example/ios/Pods/Headers/Public/React-hermes -Xcc -IX/example/ios/Pods/Headers/Public/React-idlecallbacksnativemodule -Xcc -IX/example/ios/Pods/Headers/Public/React-jserrorhandler -Xcc -IX/example/ios/Pods/Headers/Public/React-jsi -Xcc -IX/example/ios/Pods/Headers/Public/React-jsiexecutor -Xcc -IX/example/ios/Pods/Headers/Public/React-jsinspector -Xcc -IX/example/ios/Pods/Headers/Public/React-logger -Xcc -IX/example/ios/Pods/Headers/Public/React-microtasksnativemodule -Xcc -IX/example/ios/Pods/Headers/Public/React-nativeconfig -Xcc -IX/example/ios/Pods/Headers/Public/React-perflogger -Xcc -IX/example/ios/Pods/Headers/Public/React-performancetimeline -Xcc -IX/example/ios/Pods/Headers/Public/React-rendererconsistency -Xcc -IX/example/ios/Pods/Headers/Public/React-rendererdebug -Xcc -IX/example/ios/Pods/Headers/Public/React-runtimeexecutor -Xcc -IX/example/ios/Pods/Headers/Public/React-runtimescheduler -Xcc -IX/example/ios/Pods/Headers/Public/React-timing -Xcc -IX/example/ios/Pods/Headers/Public/React-utils -Xcc -IX/example/ios/Pods/Headers/Public/ReactCodegen -Xcc -IX/example/ios/Pods/Headers/Public/ReactCommon -Xcc -IX/example/ios/Pods/Headers/Public/Yoga -Xcc -IX/example/ios/Pods/Headers/Public/boost -Xcc -IX/example/ios/Pods/Headers/Public/fast_float -Xcc -IX/example/ios/Pods/Headers/Public/fmt -Xcc -IX/example/ios/Pods/Headers/Public/glog -Xcc -IX/example/ios/Pods/Headers/Public/hermes-engine -Xcc -IX/example/ios/Pods/Headers/Public/NativeLocalStorage -Xcc -IX/example/ios/Pods/boost -Xcc -IX/example/ios/Pods/Headers/Private/Yoga -Xcc -I/Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/DerivedSources-normal/arm64 -Xcc -I/Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/DerivedSources/arm64 -Xcc -I/Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG\=1 -Xcc -DDEBUG\=1 -Xcc -DCOCOAPODS\=1 -module-name NativeLocalStorage -frontend-parseable-output -disable-clang-spi -target-sdk-version 18.2 -target-sdk-name iphonesimulator18.2 -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/swift/host/plugins\#/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/local/lib/swift/host/plugins\#/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/swift-plugin-server -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -parse-as-library -num-threads 10 -o /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage.o -index-unit-output-path /Pods.build/Debug-iphonesimulator/NativeLocalStorage.build/Objects-normal/arm64/NativeLocalStorage.o -index-store-path /Users/olivier/Library/Developer/Xcode/DerivedData/TurboModuleExample-bjopqvlvjivpojbluuzbgjwgdgwc/Index.noindex/DataStore -index-system-modules

<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "NativeLocalStorage-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/NativeLocalStorage/NativeLocalStorage-umbrella.h:13:9: note: in file included from X/example/ios/Pods/Headers/Public/NativeLocalStorage/NativeLocalStorage-umbrella.h:13:
#import "NativeLocalStorageSpec.h"
        ^
X/example/ios/Pods/Headers/Public/NativeLocalStorage/NativeLocalStorageSpec.h:15:2: error: This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
 ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "NativeLocalStorage-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/NativeLocalStorage/NativeLocalStorage-umbrella.h:13:9: note: in file included from X/example/ios/Pods/Headers/Public/NativeLocalStorage/NativeLocalStorage-umbrella.h:13:
#import "NativeLocalStorageSpec.h"
        ^
X/example/ios/Pods/Headers/Public/NativeLocalStorage/NativeLocalStorageSpec.h:23:9: note: in file included from X/example/ios/Pods/Headers/Public/NativeLocalStorage/NativeLocalStorageSpec.h:23:
#import <RCTRequired/RCTRequired.h>
        ^
X/example/ios/Pods/Headers/Public/RCTRequired/RCTRequired/RCTRequired.h:8:10: error: 'utility' file not found
#include <utility>
         ^
X/example/ios/Pods/Headers/Public/NativeLocalStorage/NativeLocalStorageSpec.h:24:9: note: while building module 'RCTTypeSafety' imported from X/example/ios/Pods/Headers/Public/NativeLocalStorage/NativeLocalStorageSpec.h:24:
#import <RCTTypeSafety/RCTConvertHelpers.h>
        ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "RCTTypeSafety-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety-umbrella.h:13:9: note: in file included from X/example/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety-umbrella.h:13:
#import "RCTTypeSafety/RCTConvertHelpers.h"
        ^
X/example/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety/RCTConvertHelpers.h:8:9: error: 'optional' file not found
#import <optional>
        ^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "ReactCommon-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/ReactCommon/ReactCommon-umbrella.h:13:9: note: in file included from X/example/ios/Pods/Headers/Public/ReactCommon/ReactCommon-umbrella.h:13:
#import "react/bridging/Array.h"
        ^
X/example/ios/Pods/Headers/Public/ReactCommon/react/bridging/Array.h:10:10: note: in file included from X/example/ios/Pods/Headers/Public/ReactCommon/react/bridging/Array.h:10:
#include <react/bridging/Base.h>
         ^
X/example/ios/Pods/Headers/Public/ReactCommon/react/bridging/Base.h:10:10: note: in file included from X/example/ios/Pods/Headers/Public/ReactCommon/react/bridging/Base.h:10:
#include <jsi/jsi.h>
         ^
X/example/ios/Pods/Headers/Public/React-jsi/jsi/jsi.h:10:10: error: 'cassert' file not found
#include <cassert>
         ^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:13:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:13:
#import "double-conversion/bignum-dtoa.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/bignum-dtoa.h:31:10: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/bignum-dtoa.h:31:
#include "utils.h"
         ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/utils.h:139:1: error: unknown type name 'namespace'
namespace double_conversion {
^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:13:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:13:
#import "double-conversion/bignum-dtoa.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/bignum-dtoa.h:31:10: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/bignum-dtoa.h:31:
#include "utils.h"
         ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/utils.h:139:28: error: expected ';' after top level declarator
namespace double_conversion {
                           ^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:13:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:13:
#import "double-conversion/bignum-dtoa.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/bignum-dtoa.h:33:1: error: unknown type name 'namespace'
namespace double_conversion {
^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:13:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:13:
#import "double-conversion/bignum-dtoa.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/bignum-dtoa.h:33:28: error: expected ';' after top level declarator
namespace double_conversion {
                           ^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:14:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:14:
#import "double-conversion/bignum.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/bignum.h:33:1: error: unknown type name 'namespace'
namespace double_conversion {
^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:14:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:14:
#import "double-conversion/bignum.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/bignum.h:33:28: error: expected ';' after top level declarator
namespace double_conversion {
                           ^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:15:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:15:
#import "double-conversion/cached-powers.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/cached-powers.h:31:10: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/cached-powers.h:31:
#include "diy-fp.h"
         ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/diy-fp.h:33:1: error: unknown type name 'namespace'
namespace double_conversion {
^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:15:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:15:
#import "double-conversion/cached-powers.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/cached-powers.h:31:10: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/cached-powers.h:31:
#include "diy-fp.h"
         ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/diy-fp.h:33:28: error: expected ';' after top level declarator
namespace double_conversion {
                           ^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:15:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:15:
#import "double-conversion/cached-powers.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/cached-powers.h:33:1: error: unknown type name 'namespace'
namespace double_conversion {
^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:15:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:15:
#import "double-conversion/cached-powers.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/cached-powers.h:33:28: error: expected ';' after top level declarator
namespace double_conversion {
                           ^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:17:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:17:
#import "double-conversion/double-conversion.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/double-conversion.h:33:1: error: unknown type name 'namespace'
namespace double_conversion {
^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:17:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:17:
#import "double-conversion/double-conversion.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/double-conversion.h:33:28: error: expected ';' after top level declarator
namespace double_conversion {
                           ^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:18:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:18:
#import "double-conversion/fast-dtoa.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/fast-dtoa.h:33:1: error: unknown type name 'namespace'
namespace double_conversion {
^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:18:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:18:
#import "double-conversion/fast-dtoa.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/fast-dtoa.h:33:28: error: expected ';' after top level declarator
namespace double_conversion {
                           ^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:19:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:19:
#import "double-conversion/fixed-dtoa.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/fixed-dtoa.h:33:1: error: unknown type name 'namespace'
namespace double_conversion {
^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:19:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:19:
#import "double-conversion/fixed-dtoa.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/fixed-dtoa.h:33:28: error: expected ';' after top level declarator
namespace double_conversion {
                           ^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:20:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:20:
#import "double-conversion/ieee.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/ieee.h:33:1: error: unknown type name 'namespace'
namespace double_conversion {
^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:20:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:20:
#import "double-conversion/ieee.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/ieee.h:33:28: error: expected ';' after top level declarator
namespace double_conversion {
                           ^
X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:9: note: while building module 'ReactCommon' imported from X/example/ios/Pods/Headers/Public/React-NativeModulesApple/ReactCommon/RCTTurboModule.h:16:
#import <ReactCommon/TurboModule.h>
        ^
X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:10: note: while building module 'DoubleConversion' imported from X/example/ios/Pods/Headers/Public/RCT-Folly/folly/Conv.h:130:
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "DoubleConversion-umbrella.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:21:9: note: in file included from X/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion-umbrella.h:21:
#import "double-conversion/strtod.h"
        ^
X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/strtod.h:33:1: error: unknown type name 'namespace'
namespace double_conversion {
^
<unknown>:0: error: too many errors emitted, stopping now
<unknown>:0: error: could not build Objective-C module 'NativeLocalStorage'

X/example/ios/Pods/Headers/Public/NativeLocalStorage/NativeLocalStorageSpec.h:15:2: This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.

X/example/ios/Pods/Headers/Public/RCTRequired/RCTRequired/RCTRequired.h:8:10: 'utility' file not found

X/example/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety/RCTConvertHelpers.h:8:9: 'optional' file not found

X/example/ios/Pods/Headers/Public/React-jsi/jsi/jsi.h:10:10: 'cassert' file not found

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/utils.h:139:1: Unknown type name 'namespace'

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/utils.h:139:28: Expected ';' after top level declarator

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/bignum-dtoa.h:33:1: Unknown type name 'namespace'

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/bignum-dtoa.h:33:28: Expected ';' after top level declarator

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/bignum.h:33:1: Unknown type name 'namespace'

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/bignum.h:33:28: Expected ';' after top level declarator

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/diy-fp.h:33:1: Unknown type name 'namespace'

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/diy-fp.h:33:28: Expected ';' after top level declarator

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/cached-powers.h:33:1: Unknown type name 'namespace'

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/cached-powers.h:33:28: Expected ';' after top level declarator

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/double-conversion.h:33:1: Unknown type name 'namespace'

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/double-conversion.h:33:28: Expected ';' after top level declarator

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/fast-dtoa.h:33:1: Unknown type name 'namespace'

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/fast-dtoa.h:33:28: Expected ';' after top level declarator

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/fixed-dtoa.h:33:1: Unknown type name 'namespace'

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/fixed-dtoa.h:33:28: Expected ';' after top level declarator

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/ieee.h:33:1: Unknown type name 'namespace'

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/ieee.h:33:28: Expected ';' after top level declarator

X/example/ios/Pods/Headers/Public/DoubleConversion/double-conversion/strtod.h:33:1: Unknown type name 'namespace'

Too many errors emitted, stopping now

Could not build Objective-C module 'NativeLocalStorage'



Build failed    31/01/2025, 22:43    88.7 seconds

Reproducer

https://github.com/mgcrea/react-native-turbo-module-library-example/tree/swift

Screenshots and Videos

Image
@mgcrea mgcrea added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Jan 31, 2025
@mgcrea mgcrea changed the title Cannot create a library exposing a Turbo Module with Swift code Cannot create a library exposing a Turbo Module with Swift code (0.77+) Jan 31, 2025
@mgcrea
Copy link
Author

mgcrea commented Feb 2, 2025

Found out the correct settings:

You need:

  s.source_files = "ios/**/*.{m,mm,cpp,swift}"

In the podspec file (no .h).

Then you need to use generated headers in the .h file:

//  RCTNativeLocalStorage.h
//  TurboModuleExample

#import "generated/NativeLocalStorageSpec/NativeLocalStorageSpec.h"
#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface RCTNativeLocalStorage : NSObject <NativeLocalStorageSpec>

@end

NS_ASSUME_NONNULL_END

You can find a working example here if you encounter the same issue:

https://github.com/mgcrea/react-native-turbo-module-library-example/tree/swift

@mgcrea mgcrea closed this as completed Feb 2, 2025
@cortinico cortinico added the Resolution: Answered When the issue is resolved with a simple answer label Feb 3, 2025
@AyushBharadwaj
Copy link

Hello @mgcrea , @cortinico
I'm encountering a linker error when compiling the React Native library with Turbo Modules and Swift support in RN version 0.77.
The error is: duplicate symbol 'OBJC_IVAR$_RCTAppDependencyProvider._thirdPartyFabricComponents' in:
/Users/mac/Library/Developer/Xcode/DerivedData/.../ReactAppDependencyProvider/libReactAppDependencyProvider.a2
ld: 10 duplicate symbols
clang: error: linker command failed with exit code 1

Context:
React Native Version: 0.77
Issue: Occurs during the compilation React Native Library with Turbo Modules and Swift support.
Platform: iOS
Xcode: 16.2

@mgcrea
Copy link
Author

mgcrea commented Feb 6, 2025

I have published a few repository for sample working projects using swift that you can check to help you:

Hopefully that helps!

@AyushBharadwaj
Copy link

Hello @mgcrea I tried using the example from the above repository, but I'm encountering an issue: the file 'generated/NativeLocalStorageSpec/NativeLocalStorageSpec.h' cannot be found.

@mgcrea
Copy link
Author

mgcrea commented Feb 7, 2025

You need to run npm run codegen:ios to generate it if you are using the library template.

@AyushBharadwaj
Copy link

AyushBharadwaj commented Feb 7, 2025

@mgcrea ,
Can you suggest the steps for creating a new library with TurboModule on React Native 0.77.0? I am facing some issues, including:

10 duplicate symbols
Linker command failed with exit code 1 (use -v to see invocation)

Here are the steps I am following:

  1. Run: npx create-react-native-library@latest
  2. Install dependencies in the root folder: yarn install
  3. Navigate to the example project: cd example
  4. Go to the iOS folder: cd ios
  5. Install CocoaPods: pod install
  6. Build the iOS example project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Triage 🔍 Resolution: Answered When the issue is resolved with a simple answer Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests

3 participants