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

iOS 18.2 simulator build time error: compiling for iOS 15.1, but module 'CxxStdlib' has a minimum deployment target of iOS 16.0 #422

Open
3 of 5 tasks
skurgansky-sugarcrm opened this issue Dec 12, 2024 · 19 comments
Labels
build/setup Issue is related to building Nitro Modules or autolinking

Comments

@skurgansky-sugarcrm
Copy link

How were you trying to build the app?

expo -> prebuild
expo -> ios

The following build commands failed:
EmitSwiftModule normal arm64 (in target 'NitroModules' from project 'Pods')
SwiftEmitModule normal arm64 Emitting\ module\ for\ NitroModules (in target 'NitroModules' from project 'Pods')
Building workspace nomad with scheme nomad and configuration Debug

Full build logs

EmitSwiftModule normal arm64 (in target 'NitroModules' from project 'Pods')
    cd /Users/teemo/Work/test/nomadRN/ios/Pods
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types /Users/teemo/Work/test/nomadRN/node_modules/react-native-nitro-modules/ios/core/AnyMapHolder.swift /Users/teemo/Work/test/nomadRN/node_modules/react-native-nitro-modules/ios/core/ArrayBufferHolder.swift /Users/teemo/Work/test/nomadRN/node_modules/react-native-nitro-modules/ios/core/HybridObjectSpec.swift /Users/teemo/Work/test/nomadRN/node_modules/react-native-nitro-modules/ios/core/Promise.swift /Users/teemo/Work/test/nomadRN/node_modules/react-native-nitro-modules/ios/core/RuntimeError.swift /Users/teemo/Work/test/nomadRN/node_modules/react-native-nitro-modules/ios/utils/SwiftClosure.swift -target arm64-apple-ios15.1-simulator -Xllvm -aarch64-use-tbi -enable-objc-interop -cxx-interoperability-mode\=default -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk -I /Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Products/Debug-iphonesimulator/NitroModules -F /Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Products/Debug-iphonesimulator/NitroModules -F /Users/teemo/Work/test/nomadRN/ios/Pods/hermes-engine/destroot/Library/Frameworks/universal -F /Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/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/teemo/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity\=checked -Onone -D DEBUG -D COCOAPODS -serialize-debugging-options -const-gather-protocols-file /Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NitroModules.build/Objects-normal/arm64/NitroModules_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/teemo/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -Xcc -working-directory -Xcc /Users/teemo/Work/test/nomadRN/ios/Pods -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -file-compilation-dir /Users/teemo/Work/test/nomadRN/ios/Pods -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/RCTDeprecation/RCTDeprecation.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/RCTFabric/React-RCTFabric.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React/React-Core.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/ReactCodegen/ReactCodegen.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/ReactCommon/ReactCommon.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React_Fabric/React-Fabric.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React_FabricComponents/React-FabricComponents.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React_NativeModulesApple/React-NativeModulesApple.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/folly/RCT-Folly.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/glog/glog.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/jsi/React-jsi.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/jsinspector_modern/React-jsinspector.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/react_debug/React-debug.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/react_featureflags/React-featureflags.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/react_renderer_debug/React-rendererdebug.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/react_renderer_graphics/React-graphics.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/react_renderer_imagemanager/React-ImageManager.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/react_utils/React-utils.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/reacthermes/React-hermes.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/yoga/Yoga.modulemap -Xcc -fmodule-map-file\=/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/NitroModules/NitroModules.modulemap -Xcc -std\=c++20 -Xcc -D_LIBCPP_HARDENING_MODE\=_LIBCPP_HARDENING_MODE_DEBUG -Xcc -ivfsstatcache -Xcc /Users/teemo/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator18.2-22C146-07b28473f605e47e75261259d3ef3b5a.sdkstatcache -Xcc -I/Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NitroModules.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NitroModules.build/NitroModules-generated-files.hmap -Xcc -I/Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NitroModules.build/NitroModules-own-target-headers.hmap -Xcc -I/Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NitroModules.build/NitroModules-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Pods-8699adb1dd336b26511df848a716bd42-VFS-iphonesimulator/all-product-headers.yaml -Xcc -iquote -Xcc /Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NitroModules.build/NitroModules-project-headers.hmap -Xcc -I/Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Products/Debug-iphonesimulator/NitroModules/include -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Private -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Private/NitroModules -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/DoubleConversion -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/FBLazyVector -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/RCT-Folly -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/RCTRequired -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/RCTTypeSafety -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-Core -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-Fabric -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-FabricComponents -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-FabricImage -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-ImageManager -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-NativeModulesApple -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-RCTFabric -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-RCTText -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-callinvoker -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-cxxreact -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-debug -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-featureflags -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-graphics -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-hermes -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-jsi -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-jsiexecutor -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-jsinspector -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-logger -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-nativeconfig -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-perflogger -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-performancetimeline -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-rendererconsistency -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-rendererdebug -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-runtimeexecutor -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-runtimescheduler -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-timing -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/React-utils -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/ReactCodegen -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/ReactCommon -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/Yoga -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/boost -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/fmt -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/glog -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Public/hermes-engine -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/boost -Xcc -I/Users/teemo/Work/test/nomadRN/ios/Pods/Headers/Private/Yoga -Xcc -I/Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NitroModules.build/DerivedSources-normal/arm64 -Xcc -I/Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NitroModules.build/DerivedSources/arm64 -Xcc -I/Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NitroModules.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG\=1 -Xcc -DDEBUG\=1 -Xcc -DCOCOAPODS\=1 -Xcc -DPOD_CONFIGURATION_DEBUG\=1 -Xcc -DDEBUG\=1 -Xcc -DFOLLY_NO_CONFIG -Xcc -DFOLLY_CFG_NO_COROUTINES -module-name NitroModules -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 -emit-module-doc-path /Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NitroModules.build/Objects-normal/arm64/NitroModules.swiftdoc -emit-module-source-info-path /Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NitroModules.build/Objects-normal/arm64/NitroModules.swiftsourceinfo -emit-objc-header-path /Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NitroModules.build/Objects-normal/arm64/NitroModules-Swift.h -serialize-diagnostics-path /Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NitroModules.build/Objects-normal/arm64/NitroModules-master-emit-module.dia -emit-dependencies-path /Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NitroModules.build/Objects-normal/arm64/NitroModules-master-emit-module.d -o /Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NitroModules.build/Objects-normal/arm64/NitroModules.swiftmodule -emit-abi-descriptor-path /Users/teemo/Library/Developer/Xcode/DerivedData/nomad-aoeqyjjllnqfjibiyhrishyluhbb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NitroModules.build/Objects-normal/arm64/NitroModules.abi.json

<unknown>:0: error: compiling for iOS 15.1, but module 'CxxStdlib' has a minimum deployment target of iOS 16.0: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CxxStdlib.swiftmodule/arm64-apple-ios-simulator.swiftmodule

Project dependencies

"dependencies": {
    "@expo/vector-icons": "^14.0.4",
    "@react-navigation/bottom-tabs": "^7.0.0",
    "@react-navigation/native": "^7.0.0",
    "@reduxjs/toolkit": "^2.5.0",
    "@shopify/flash-list": "~1.7.2",
    "@shopify/react-native-skia": "~1.7.2",
    "add": "^2.0.6",
    "dayjs": "^1.11.13",
    "eslint": "^8.56.0",
    "expo": "~52.0.18",
    "expo-asset": "~11.0.1",
    "expo-blur": "~14.0.1",
    "expo-build-properties": "~0.13.1",
    "expo-constants": "~17.0.3",
    "expo-device": "~7.0.1",
    "expo-font": "~13.0.1",
    "expo-haptics": "~14.0.0",
    "expo-linking": "~7.0.3",
    "expo-router": "~4.0.11",
    "expo-splash-screen": "~0.29.18",
    "expo-status-bar": "~2.0.0",
    "expo-symbols": "~0.2.0",
    "expo-system-ui": "~4.0.5",
    "expo-web-browser": "~14.0.1",
    "lodash": "^4.17.21",
    "prettier": "^3.4.2",
    "react": "18.3.1",
    "react-dom": "18.3.1",
    "react-error-boundary": "^4.1.2",
    "react-hook-form": "^7.54.0",
    "react-native": "~0.76.5",
    "react-native-calendars": "^1.1307.0",
    "react-native-edge-to-edge": "^1.1.3",
    "react-native-gesture-handler": "~2.21.2",
    "react-native-get-random-values": "~1.11.0",
    "react-native-mmkv": "^3.1.0",
    "react-native-nitro-modules": "^0.18.2",
    "react-native-reanimated": "~3.16.5",
    "react-native-safe-area-context": "5.0.0",
    "react-native-screens": "~4.3.0",
    "react-native-svg": "15.10.1",
    "react-native-svg-transformer": "~1.5.0",
    "react-native-swipeable-item": "~2.0.9",
    "react-native-unistyles": "^3.0.0-beta.1",
    "react-native-web": "~0.19.13",
    "react-native-webview": "~13.12.5",
    "react-redux": "^9.1.2",
    "redux-persist": "^6.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.26.0",
    "@redux-devtools/remote": "^0.9.3",
    "@types/jest": "^29.5.14",
    "@types/react": "~18.3.13",
    "@types/react-test-renderer": "^18.3.0",
    "jest": "~29.7.0",
    "jest-expo": "~52.0.2",
    "react-test-renderer": "18.3.1",
    "typescript": "^5.7.2"
  },

Nitro Modules Version

^0.18.2

Nitrogen Version

No response

Target platforms

iOS

Operating system

MacOS

Can you build the Nitro Modules Example app?

I didn't try (⚠️ your issue might get ignored & closed if you don't try this)

Additional information

@skurgansky-sugarcrm skurgansky-sugarcrm added the build/setup Issue is related to building Nitro Modules or autolinking label Dec 12, 2024
@mrousavy
Copy link
Owner

compiling for iOS 15.1, but module 'CxxStdlib' has a minimum deployment target of iOS 16.0

You are using 15.1., but need to use iOS 16.

@skurgansky-sugarcrm
Copy link
Author

skurgansky-sugarcrm commented Dec 12, 2024

yeah, but i did this in app.json without any effect on this problem
https://docs.expo.dev/versions/latest/sdk/build-properties/#example-appjson-with-config-plugin

[
       "expo-build-properties",
       {
         "ios": {
           "newArchEnabled": true,
           "deploymentTarget": "16.6"
         },
         "android": {
           "newArchEnabled": true
         }
       }
     ]

this is probably expo issue

@skurgansky-sugarcrm
Copy link
Author

reverting to previous expo and RN didn't help. I have also downloaded and installed new ios 18.2 simulator today. Could it be the reason?
image

Minimum deployments is set to 16.6
image

@akuul
Copy link

akuul commented Dec 12, 2024

Seems to be something related to Xcode. Started getting this too just few minutes ago after updating to Xcode 16.2. Was building completely fine this morning prior 16.2

Edit:
Seems that it should get downgraded for Swift 6.1 ? swiftlang/swift#77979

@skurgansky-sugarcrm
Copy link
Author

yeah. xcode was updated today...

@skurgansky-sugarcrm
Copy link
Author

@mrousavy https://github.com/jpudysz/react-native-unistyles/tree/v3.0.0-beta.2
here this example doesn't compile with same error related to nitro

@ferdinanddoremus
Copy link

ferdinanddoremus commented Dec 13, 2024

I guess I did not pay attention and updated Xcode to 16.2, and now one of my project running react-native-unistyles is not building anymore (was building yesterday morning). Other project without this package are building fine.

Here is the expo log when building on sim iOS18.0 :

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:499FEC7E-7743-4FE3-8000-8C08EE1D2D90, OS:18.0, name:iPhone 16 Pro }
{ platform:iOS Simulator, id:499FEC7E-7743-4FE3-8000-8C08EE1D2D90, OS:18.0, name:iPhone 16 Pro }
** BUILD FAILED **


The following build commands failed:
	EmitSwiftModule normal arm64 (in target 'NitroModules' from project 'Pods')
	SwiftEmitModule normal arm64 Emitting\ module\ for\ NitroModules (in target 'NitroModules' from project 'Pods')
	Building workspace io182repro with scheme io182repro and configuration Debug
(3 failures)

Here is the log for iOS 18.2

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:62528D40-C959-4828-AFA4-81E30CB3AB67, OS:18.2, name:iPhone 16 Pro }
{ platform:iOS Simulator, id:62528D40-C959-4828-AFA4-81E30CB3AB67, OS:18.2, name:iPhone 16 Pro }
** BUILD FAILED **


The following build commands failed:
	EmitSwiftModule normal arm64 (in target 'NitroModules' from project 'Pods')
	SwiftEmitModule normal arm64 Emitting\ module\ for\ NitroModules (in target 'NitroModules' from project 'Pods')
	Building workspace io182repro with scheme io182repro and configuration Debug
(3 failures)

Weird thing is, it is actually building on real device (iOS 18.2).

I found this issue but not sure if related to nitro modules or unistyles actually.
I made this repro repo with fresh expo install + unistyles only.
Don't know if it helps.

Should I open an issue on unistyles repo ?

@skurgansky-sugarcrm
Copy link
Author

skurgansky-sugarcrm commented Dec 13, 2024

I guess I did not pay attention and updated Xcode to 16.2, and now one of my project running [react-native-unistyles]

unistyle betta uses nitro module

Should I open an issue on unistyles repo ?

i have open a question. it is not a Unistyle or RN/Expo issue, they are being build fine on my machine with xcode 16.2

this issue is related to value of min_ios_version_supported :ios => min_ios_version_supported, in podfile runtime.

@katanyaJATI
Copy link

I believe this issue can be temporarily resolved by modifying the Podfile with a post-install hook. You can add the following code to your Podfile:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.6'
    end
  end
end

Test this and see if it resolves the problem!

@callaars
Copy link

Can confirm @katanyaJATI 's workaround works.

@skurgansky-sugarcrm
Copy link
Author

on RN projects it will work but it's hardcoded version for targets. what it work for pods?

I have noticed that expo build properties plugin doesn't change 2 of 4 IPHONEOS_DEPLOYMENT_TARGET values in xcodeproj file...

@mrousavy
Copy link
Owner

Hey - yea I'm getting the same error now after upgrading to Xcode 16.2.

Seems like they broke something in swiftlang/swift@b87b263 which was reported in swiftlang/swift#77909 and then fixed in swiftlang/swift#77979.

It looks like the fix didn't land in Xcode 16.2., as I still see the error:

- Compiling for iOS 15.1, but module 'CxxStdlib' has a minimum deployment target of iOS 16.0: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CxxStdlib.swiftmodule/arm64-apple-ios-simulator.swiftmodule

@skurgansky-sugarcrm
Copy link
Author

i managed to build my project after i have set
for each target -> General -> Minimum deployments -> IOS: 16
build settings -> iOS Deployment target -> iOS 16

  • same thing for PODS:
    Project -> Pods -> build settings -> iOS Deployment target -> iOS 16
    For each Target in there with same error repeat same steps

but this is crazy to repeat each time i do expo prebuild :)

@mrousavy
Copy link
Owner

The issue will be fixed by swiftlang/swift#78242.

Note: the build still works fine for physical devices, for "My Mac", for tvOS, and visionOS targets. It's "just" iOS Simulators that are not working right now in Xcode 16.2.

@mrousavy mrousavy changed the title ios 18.2 simulator build time error iOS 18.2 simulator build time error: compiling for iOS 15.1, but module 'CxxStdlib' has a minimum deployment target of iOS 16.0 Dec 19, 2024
@ggraciano
Copy link

Manually downloading the latest Swift development snapshot here and selecting the toolchain resolved this issue for me, but led to other issues related to Yoga for me. As a workaround, without having to do any manual configurations, I downgraded to Xcode 16.1.

@skurgansky-sugarcrm
Copy link
Author

did downgrade on xCode as well

@RafeeqShodeinde
Copy link

The issue will be fixed by swiftlang/swift#78242.

Note: the build still works fine for physical devices, for "My Mac", for tvOS, and visionOS targets. It's "just" iOS Simulators that are not working right now in Xcode 16.2.

Hello, please can you share the process for applying this fix you mentioned to Xcode 16.2? Where I can locate the "stdlib/cmake/modules/SwiftSource.cmake" file to add the changes for the ios simulator? Thanks in advance

@corasan
Copy link

corasan commented Jan 2, 2025

I wrote this config plugin for expo to set the targets to iOS 16.0. Should be enough for now until Xcode releases the fix.

const { withDangerousMod } = require('@expo/config-plugins');
const { mergeContents } = require('@expo/config-plugins/build/utils/generateCode');
const fs = require('fs');
const path = require('path');

const withIosDeploymentTarget = (config) => {
  return withDangerousMod(config, [
    'ios',
    async (config) => {
      // Find the Podfile
      const podfile = path.join(config.modRequest.platformProjectRoot, 'Podfile')
      // Read the Podfile
      const podfileContents = fs.readFileSync(podfile, 'utf8')
      // Merge the contents of the Podfile with the new content setting 
      // the deployment target of all targets to 16.0
      const setDeploymentTarget = mergeContents({
        tag: 'ios-deployment-target',
        src: podfileContents,
        newSrc: `    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
      end
    end`,
        anchor: /post_install do \|installer\|/i,
        offset: 1,
        comment: '#'
      })

      if (!setDeploymentTarget.didMerge) {
        console.log('Failed to set iOS deployment target')
        return config
      }

      fs.writeFileSync(podfile, setDeploymentTarget.contents)

      return config
    }
  ])
}

module.exports = withIosDeploymentTarget;

@cetfu
Copy link

cetfu commented Feb 12, 2025

I believe this issue can be temporarily resolved by modifying the Podfile with a post-install hook. You can add the following code to your Podfile:

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.6'
end
end
end
Test this and see if it resolves the problem!

i'm using react-native cli. fixed for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build/setup Issue is related to building Nitro Modules or autolinking
Projects
None yet
Development

No branches or pull requests

10 participants