[iOS] - Undefined symbols for architecture arm64
Description
So like the title of this issue says, I'm getting Undefined symbols for architecture arm64 error for several RNS elements.
This happens as soon as I enable the new architecture in my project, and goes away as soon as I disable it.
The thing is that react-native v0.82 is already out and they are not giving support for old architecture anymore, so my team needs to make it work.
I got this to work by adding a post_install script in my Podfile, but I'm not sure how stable and reliable it is.
More than like a bug or issue, this is something like a discussion asking if anyone has experienced this before and knows or have a better resolution that can be considered as stable and reliable.
Showing All Errors Only
Undefined symbol: facebook::react::RNSScreenProps::RNSScreenProps(facebook::react::PropsParserContext const&, facebook::react::RNSScreenProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSSearchBarProps::RNSSearchBarProps(facebook::react::PropsParserContext const&, facebook::react::RNSSearchBarProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSBottomTabsProps::RNSBottomTabsProps(facebook::react::PropsParserContext const&, facebook::react::RNSBottomTabsProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSScreenStackProps::RNSScreenStackProps(facebook::react::PropsParserContext const&, facebook::react::RNSScreenStackProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSSafeAreaViewProps::RNSSafeAreaViewProps(facebook::react::PropsParserContext const&, facebook::react::RNSSafeAreaViewProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSScreenFooterProps::RNSScreenFooterProps(facebook::react::PropsParserContext const&, facebook::react::RNSScreenFooterProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSScreenContainerProps::RNSScreenContainerProps(facebook::react::PropsParserContext const&, facebook::react::RNSScreenContainerProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSBottomTabsScreenProps::RNSBottomTabsScreenProps(facebook::react::PropsParserContext const&, facebook::react::RNSBottomTabsScreenProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSFullWindowOverlayProps::RNSFullWindowOverlayProps(facebook::react::PropsParserContext const&, facebook::react::RNSFullWindowOverlayProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSSearchBarComponentName
Undefined symbol: facebook::react::RNSScreenStackComponentName
Undefined symbol: facebook::react::RNSScreenContentWrapperProps::RNSScreenContentWrapperProps(facebook::react::PropsParserContext const&, facebook::react::RNSScreenContentWrapperProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSScreenFooterComponentName
Undefined symbol: facebook::react::RNSScreenContainerComponentName
Undefined symbol: facebook::react::RNSScreenStackHeaderConfigProps::RNSScreenStackHeaderConfigProps(facebook::react::PropsParserContext const&, facebook::react::RNSScreenStackHeaderConfigProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSBottomTabsScreenComponentName
Undefined symbol: facebook::react::RNSScreenStackHeaderSubviewProps::RNSScreenStackHeaderSubviewProps(facebook::react::PropsParserContext const&, facebook::react::RNSScreenStackHeaderSubviewProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSScreenNavigationContainerProps::RNSScreenNavigationContainerProps(facebook::react::PropsParserContext const&, facebook::react::RNSScreenNavigationContainerProps const&, facebook::react::RawProps const&)
Undefined symbol: facebook::react::RNSScreenContentWrapperComponentName
Undefined symbol: facebook::react::RNSScreenNavigationContainerComponentName
Undefined symbol: facebook::react::RNSScreenEventEmitter::onDisappear(facebook::react::RNSScreenEventEmitter::OnDisappear) const
Undefined symbol: facebook::react::RNSScreenEventEmitter::onDismissed(facebook::react::RNSScreenEventEmitter::OnDismissed) const
Undefined symbol: facebook::react::RNSScreenEventEmitter::onWillAppear(facebook::react::RNSScreenEventEmitter::OnWillAppear) const
Undefined symbol: facebook::react::RNSScreenEventEmitter::onGestureCancel(facebook::react::RNSScreenEventEmitter::OnGestureCancel) const
Undefined symbol: facebook::react::RNSScreenEventEmitter::onWillDisappear(facebook::react::RNSScreenEventEmitter::OnWillDisappear) const
Undefined symbol: facebook::react::RNSScreenEventEmitter::onHeaderHeightChange(facebook::react::RNSScreenEventEmitter::OnHeaderHeightChange) const
Undefined symbol: facebook::react::RNSScreenEventEmitter::onSheetDetentChanged(facebook::react::RNSScreenEventEmitter::OnSheetDetentChanged) const
Undefined symbol: facebook::react::RNSScreenEventEmitter::onTransitionProgress(facebook::react::RNSScreenEventEmitter::OnTransitionProgress) const
Undefined symbol: facebook::react::RNSScreenEventEmitter::onNativeDismissCancelled(facebook::react::RNSScreenEventEmitter::OnNativeDismissCancelled) const
Undefined symbol: facebook::react::RNSScreenEventEmitter::onAppear(facebook::react::RNSScreenEventEmitter::OnAppear) const
Undefined symbol: facebook::react::RNSSearchBarEventEmitter::onChangeText(facebook::react::RNSSearchBarEventEmitter::OnChangeText) const
Undefined symbol: facebook::react::RNSSearchBarEventEmitter::onSearchBlur(facebook::react::RNSSearchBarEventEmitter::OnSearchBlur) const
Undefined symbol: facebook::react::RNSSearchBarEventEmitter::onSearchFocus(facebook::react::RNSSearchBarEventEmitter::OnSearchFocus) const
Undefined symbol: facebook::react::RNSSearchBarEventEmitter::onCancelButtonPress(facebook::react::RNSSearchBarEventEmitter::OnCancelButtonPress) const
Undefined symbol: facebook::react::RNSSearchBarEventEmitter::onSearchButtonPress(facebook::react::RNSSearchBarEventEmitter::OnSearchButtonPress) const
Undefined symbol: facebook::react::RNSBottomTabsEventEmitter::onNativeFocusChange(facebook::react::RNSBottomTabsEventEmitter::OnNativeFocusChange) const
Undefined symbol: facebook::react::RNSScreenStackEventEmitter::onFinishTransitioning(facebook::react::RNSScreenStackEventEmitter::OnFinishTransitioning) const
Undefined symbol: facebook::react::RNSBottomTabsScreenEventEmitter::onDidAppear(facebook::react::RNSBottomTabsScreenEventEmitter::OnDidAppear) const
Undefined symbol: facebook::react::RNSBottomTabsScreenEventEmitter::onWillAppear(facebook::react::RNSBottomTabsScreenEventEmitter::OnWillAppear) const
Undefined symbol: facebook::react::RNSBottomTabsScreenEventEmitter::onDidDisappear(facebook::react::RNSBottomTabsScreenEventEmitter::OnDidDisappear) const
Undefined symbol: facebook::react::RNSBottomTabsScreenEventEmitter::onWillDisappear(facebook::react::RNSBottomTabsScreenEventEmitter::OnWillDisappear) const
Undefined symbol: facebook::react::RNSScreenStackHeaderConfigEventEmitter::onPressHeaderBarButtonItem(facebook::react::RNSScreenStackHeaderConfigEventEmitter::OnPressHeaderBarButtonItem) const
Undefined symbol: facebook::react::RNSScreenStackHeaderConfigEventEmitter::onPressHeaderBarButtonMenuItem(facebook::react::RNSScreenStackHeaderConfigEventEmitter::OnPressHeaderBarButtonMenuItem) const
Linker command failed with exit code 1 (use -v to see invocation)
Maybe attaching here my post_install script someone could get some hints on what is going on:
def add_fabric_components(installer, target_name, component_path)
target = installer.pods_project.targets.find { |t| t.name == target_name }
return unless target
fabric_files = ['Props.cpp', 'ShadowNodes.cpp', 'ComponentDescriptors.cpp', 'EventEmitters.cpp', 'States.cpp']
fabric_files.each do |file_name|
file_path = File.join(installer.sandbox.root, "../build/generated/ios/react/renderer/components/#{component_path}/#{file_name}")
if File.exist?(file_path)
file_ref = installer.pods_project.new_file(file_path)
target.source_build_phase.add_file_reference(file_ref)
puts "✅ Added #{file_name} to #{target_name}"
else
puts "⚠️ #{target_name} #{file_name} not found yet (will be generated during build)"
end
end
end
add_fabric_components(installer, 'RNScreens', 'rnscreens')
Note
I know guys that I'm not providing any reproducible repo or something, I don't want you to spend time inspecting this cause I'm not sure if there's something wrong on your side, but honestly I couldn't think of a better place to ask someone to get better understanding on what's going on
Steps to reproduce
react-native v0.81.4 react-native-screens v4.17.0
1- have the project running normally
2- enable new architecture by setting ENV['RCT_NEW_ARCH_ENABLED'] = '1' on Podfile
3- cd ios && pod install
4- run the app, it throws the error shown above
Snack or a link to a repository
Screens version
4.17.0
React Native version
0.81.4
Platforms
iOS
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes
Hey! 👋
The issue doesn't seem to contain a minimal reproduction.
Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?
Hey! 👋
It looks like you've omitted a few important sections from the issue template.
Please complete Snack or a link to a repository section.
Hey @francoangulo I see your reasoning, we won't close this ticket right away in hope someone from community has experienced something similar & can help you.
The problem for us here, is that the reproduction steps you provided just work for us. We run the new architecture all the times now & we do not experience such problems. I'll try to give some initial guidance anyway.
First thing is that unless you're in some custom setup or brownfield application you should not link any libraries manually.
Try running npx react-native config (you may paste the result here, it might be helpful) to see whether it discovers the library correctly or not.
The error message you provided indicates that these symbols were either not generated by codegen or despite being generated are not visible to the compiler for some reason. It would be nice to know which case we have here. Clear all cache (rm -fr build Pods), reinstall pods & run build. If possible, paste logs from installing pods here, it should indicate whether react-native-screens lib was processed correctly. Then verify whether the files were generated or not by inspecting what's inside ios/build/generated. You should have ios/build/generated/autolinking/autolinking.json file there. Paste it here if possible.
There should also be ios/build/generated/ios/react/renderer/components/rnscreens directory with some content inside, like here:
If the files are there, inspect them, they should not be empty.
Hi @kkafar, thanks for you kind response.
What I can tell you is that definitely seems that things were generated but not linked properly. They were generated but they where missing in Pods Target > Build Phases > Compile Sources —> this is where I had to add them manually which at the end I automated with that post_install script.
That directory that you mention (ios/build/generated/ios/react/renderer/components/rnscreens) is where I'm copying the files from, either when I do it manually or via the post_install script.
Also, I can confirm that the files you show in the screenshot are there
npx react-native config output:
{
"root": "/Users/francoangulo/Documents/MSB/msb-mobile",
"reactNativePath": "/Users/francoangulo/Documents/MSB/msb-mobile/node_modules/react-native",
"reactNativeVersion": "0.81",
"dependencies": {
"react-native-screens": {
"root": "/Users/francoangulo/Documents/MSB/msb-mobile/node_modules/react-native-screens",
"name": "react-native-screens",
"platforms": {
"ios": {
"podspecPath": "/Users/francoangulo/Documents/MSB/msb-mobile/node_modules/react-native-screens/RNScreens.podspec",
"version": "4.17.0",
"configurations": [],
"scriptPhases": []
},
"android": {
"sourceDir": "/Users/francoangulo/Documents/MSB/msb-mobile/node_modules/react-native-screens/android",
"packageImportPath": "import com.swmansion.rnscreens.RNScreensPackage;",
"packageInstance": "new RNScreensPackage()",
"buildTypes": [],
"libraryName": "rnscreens",
"componentDescriptors": [
"RNSFullWindowOverlayComponentDescriptor",
"RNSScreenContainerComponentDescriptor",
"RNSScreenNavigationContainerComponentDescriptor",
"RNSScreenStackHeaderConfigComponentDescriptor",
"RNSScreenStackHeaderSubviewComponentDescriptor",
"RNSScreenStackComponentDescriptor",
"RNSSearchBarComponentDescriptor",
"RNSScreenComponentDescriptor",
"RNSScreenFooterComponentDescriptor",
"RNSScreenContentWrapperComponentDescriptor",
"RNSModalScreenComponentDescriptor",
"RNSBottomTabsComponentDescriptor",
"RNSSafeAreaViewComponentDescriptor"
],
"cmakeListsPath": "/Users/francoangulo/Documents/MSB/msb-mobile/node_modules/react-native-screens/android/src/main/jni/CMakeLists.txt",
"cxxModuleCMakeListsModuleName": null,
"cxxModuleCMakeListsPath": null,
"cxxModuleHeaderName": null,
"isPureCxxDependency": false
}
}
}
},
"commands": [
{
"name": "bundle",
"description": "Build the bundle for the provided JavaScript entry file.",
"options": [
{
"name": "--entry-file <path>",
"description": "Path to the root JS file, either absolute or relative to JS root"
},
{
"name": "--platform <string>",
"description": "Either \"ios\" or \"android\"",
"default": "ios"
},
{
"name": "--transformer <string>",
"description": "Specify a custom transformer to be used"
},
{
"name": "--dev [boolean]",
"description": "If false, warnings are disabled and the bundle is minified",
"default": true
},
{
"name": "--minify [boolean]",
"description": "Allows overriding whether bundle is minified. This defaults to false if dev is true, and true if dev is false. Disabling minification can be useful for speeding up production builds for testing purposes."
},
{
"name": "--bundle-output <string>",
"description": "File name where to store the resulting bundle, ex. /tmp/groups.bundle"
},
{
"name": "--bundle-encoding <string>",
"description": "Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer).",
"default": "utf8"
},
{
"name": "--max-workers <number>",
"description": "Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine."
},
{
"name": "--sourcemap-output <string>",
"description": "File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map"
},
{
"name": "--sourcemap-sources-root <string>",
"description": "Path to make sourcemap's sources entries relative to, ex. /root/dir"
},
{
"name": "--sourcemap-use-absolute-path",
"description": "Report SourceMapURL using its full path",
"default": false
},
{
"name": "--assets-dest <string>",
"description": "Directory name where to store assets referenced in the bundle"
},
{
"name": "--unstable-transform-profile <string>",
"description": "Experimental, transform JS for a specific JS engine. Currently supported: hermes, hermes-canary, default",
"default": "default"
},
{
"name": "--asset-catalog-dest [string]",
"description": "Path where to create an iOS Asset Catalog for images"
},
{
"name": "--reset-cache",
"description": "Removes cached files",
"default": false
},
{
"name": "--read-global-cache",
"description": "Try to fetch transformed JS code from the global cache, if configured.",
"default": false
},
{
"name": "--config <string>",
"description": "Path to the CLI configuration file"
},
{
"name": "--resolver-option <string...>",
"description": "Custom resolver options of the form key=value. URL-encoded. May be specified multiple times."
}
]
},
{
"name": "start",
"description": "Start the React Native development server.",
"options": [
{
"name": "--port <number>"
},
{
"name": "--host <string>",
"default": ""
},
{
"name": "--projectRoot <path>",
"description": "Path to a custom project root"
},
{
"name": "--watchFolders <list>",
"description": "Specify any additional folders to be added to the watch list"
},
{
"name": "--assetPlugins <list>",
"description": "Specify any additional asset plugins to be used by the packager by full filepath"
},
{
"name": "--sourceExts <list>",
"description": "Specify any additional source extensions to be used by the packager"
},
{
"name": "--max-workers <number>",
"description": "Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine."
},
{
"name": "--transformer <string>",
"description": "Specify a custom transformer to be used"
},
{
"name": "--reset-cache, --resetCache",
"description": "Removes cached files"
},
{
"name": "--custom-log-reporter-path, --customLogReporterPath <string>",
"description": "Path to a JavaScript file that exports a log reporter as a replacement for TerminalReporter"
},
{
"name": "--https",
"description": "Enables https connections to the server"
},
{
"name": "--key <path>",
"description": "Path to custom SSL key"
},
{
"name": "--cert <path>",
"description": "Path to custom SSL cert"
},
{
"name": "--config <string>",
"description": "Path to the CLI configuration file"
},
{
"name": "--no-interactive",
"description": "Disables interactive mode"
},
{
"name": "--client-logs",
"description": "[Deprecated] Enable plain text JavaScript log streaming for all connected apps. This feature is deprecated and will be removed in future.",
"default": false
}
]
},
{
"name": "codegen",
"options": [
{
"name": "--path <path>",
"description": "Path to the React Native project root.",
"default": "/Users/francoangulo/Documents/MSB/msb-mobile"
},
{
"name": "--platform <string>",
"description": "Target platform. Supported values: \"android\", \"ios\", \"all\".",
"default": "all"
},
{
"name": "--outputPath <path>",
"description": "Path where generated artifacts will be output to."
},
{
"name": "--source <string>",
"description": "Whether the script is invoked from an `app` or a `library`",
"default": "app"
}
]
},
{
"name": "log-ios",
"description": "starts iOS device syslog tail",
"options": [
{
"name": "-i --interactive",
"description": "Explicitly select simulator to tail logs from. By default it will tail logs from the first booted and available simulator."
}
]
},
{
"name": "run-ios",
"description": "builds your app and starts it on iOS simulator",
"examples": [
{
"desc": "Run on a different simulator, e.g. iPhone SE (2nd generation)",
"cmd": "npx react-native run-ios --simulator \"iPhone SE (2nd generation)\""
},
{
"desc": "Run on a connected device, e.g. Max's iPhone",
"cmd": "npx react-native run-ios --device \"Max's iPhone\""
},
{
"desc": "Run on the AppleTV simulator",
"cmd": "npx react-native run-ios --simulator \"Apple TV\" --scheme \"helloworld-tvOS\""
}
],
"options": [
{
"name": "--no-packager",
"description": "Do not launch packager while running the app"
},
{
"name": "--port <number>",
"default": 8081
},
{
"name": "--terminal <string>",
"description": "Launches the Metro Bundler in a new window using the specified terminal path.",
"default": "Apple_Terminal"
},
{
"name": "--binary-path <string>",
"description": "Path relative to project root where pre-built .app binary lives."
},
{
"name": "--list-devices",
"description": "List all available iOS devices and simulators and let you choose one to run the app. "
},
{
"name": "--udid <string>",
"description": "Explicitly set the device to use by UDID"
},
{
"name": "--simulator <string>",
"description": "Explicitly set the simulator to use. Optionally set the iOS version between parentheses at the end to match an exact version: \"iPhone 15 (17.0)\""
},
{
"name": "--mode <string>",
"description": "Explicitly set the scheme configuration to use. This option is case sensitive."
},
{
"name": "--scheme <string>",
"description": "Explicitly set Xcode scheme to use"
},
{
"name": "--destination <string>",
"description": "Explicitly extend destination e.g. \"arch=x86_64\""
},
{
"name": "--verbose",
"description": "Do not use xcbeautify or xcpretty even if installed"
},
{
"name": "--xcconfig [string]",
"description": "Explicitly set xcconfig to use"
},
{
"name": "--buildFolder <string>",
"description": "Location for iOS build artifacts. Corresponds to Xcode's \"-derivedDataPath\"."
},
{
"name": "--extra-params <string>",
"description": "Custom params that will be passed to xcodebuild command."
},
{
"name": "--target <string>",
"description": "Explicitly set Xcode target to use."
},
{
"name": "-i --interactive",
"description": "Explicitly select which scheme and configuration to use before running a build"
},
{
"name": "--force-pods",
"description": "Force CocoaPods installation"
},
{
"name": "--only-pods",
"description": "Only install Cocoapods, do not build the app"
},
{
"name": "--device [string]",
"description": "Explicitly set the device to use by name or by unique device identifier . If the value is not provided,the app will run on the first available physical device."
}
]
},
{
"name": "build-ios",
"description": "builds your app for iOS platform",
"examples": [
{
"desc": "Build the app for all iOS devices in Release mode",
"cmd": "npx react-native build-ios --mode \"Release\""
}
],
"options": [
{
"name": "--mode <string>",
"description": "Explicitly set the scheme configuration to use. This option is case sensitive."
},
{
"name": "--scheme <string>",
"description": "Explicitly set Xcode scheme to use"
},
{
"name": "--destination <string>",
"description": "Explicitly extend destination e.g. \"arch=x86_64\""
},
{
"name": "--verbose",
"description": "Do not use xcbeautify or xcpretty even if installed"
},
{
"name": "--xcconfig [string]",
"description": "Explicitly set xcconfig to use"
},
{
"name": "--buildFolder <string>",
"description": "Location for iOS build artifacts. Corresponds to Xcode's \"-derivedDataPath\"."
},
{
"name": "--extra-params <string>",
"description": "Custom params that will be passed to xcodebuild command."
},
{
"name": "--target <string>",
"description": "Explicitly set Xcode target to use."
},
{
"name": "-i --interactive",
"description": "Explicitly select which scheme and configuration to use before running a build"
},
{
"name": "--force-pods",
"description": "Force CocoaPods installation"
},
{
"name": "--only-pods",
"description": "Only install Cocoapods, do not build the app"
},
{
"name": "--device [string]",
"description": "Explicitly set the device to use by name or by unique device identifier . If the value is not provided,the app will run on the first available physical device."
}
]
},
{
"name": "log-android",
"description": "starts logkitty"
},
{
"name": "run-android",
"description": "builds your app and starts it on a connected Android emulator or device",
"options": [
{
"name": "--mode <string>",
"description": "Specify your app's build variant"
},
{
"name": "--tasks <list>",
"description": "Run custom Gradle tasks. By default it's \"assembleDebug\". Will override passed mode and variant arguments."
},
{
"name": "--active-arch-only",
"description": "Build native libraries only for the current device architecture for debug builds.",
"default": false
},
{
"name": "--extra-params <string>",
"description": "Custom params passed to gradle build command"
},
{
"name": "-i --interactive",
"description": "Explicitly select build type and flavour to use before running a build"
},
{
"name": "--no-packager",
"description": "Do not launch packager while running the app"
},
{
"name": "--port <number>",
"default": 8081
},
{
"name": "--terminal <string>",
"description": "Launches the Metro Bundler in a new window using the specified terminal path.",
"default": "Apple_Terminal"
},
{
"name": "--appId <string>",
"description": "Specify an applicationId to launch after build. If not specified, `package` from AndroidManifest.xml will be used.",
"default": ""
},
{
"name": "--appIdSuffix <string>",
"description": "Specify an applicationIdSuffix to launch after build.",
"default": ""
},
{
"name": "--main-activity <string>",
"description": "Name of the activity to start"
},
{
"name": "--device <string>",
"description": "Explicitly set the device to use by name. The value is not required if you have a single device connected."
},
{
"name": "--deviceId <string>",
"description": "**DEPRECATED** Builds your app and starts it on a specific device/simulator with the given device id (listed by running \"adb devices\" on the command line)."
},
{
"name": "--list-devices",
"description": "Lists all available Android devices and simulators and let you choose one to run the app",
"default": false
},
{
"name": "--binary-path <string>",
"description": "Path relative to project root where pre-built .apk binary lives."
},
{
"name": "--user <number>",
"description": "Id of the User Profile you want to install the app on."
}
]
},
{
"name": "build-android",
"description": "builds your app",
"options": [
{
"name": "--mode <string>",
"description": "Specify your app's build variant"
},
{
"name": "--tasks <list>",
"description": "Run custom Gradle tasks. By default it's \"assembleDebug\". Will override passed mode and variant arguments."
},
{
"name": "--active-arch-only",
"description": "Build native libraries only for the current device architecture for debug builds.",
"default": false
},
{
"name": "--extra-params <string>",
"description": "Custom params passed to gradle build command"
},
{
"name": "-i --interactive",
"description": "Explicitly select build type and flavour to use before running a build"
}
]
}
],
"healthChecks": [],
"platforms": {
"ios": {},
"android": {}
},
"assets": ["./src/assets/fonts/"],
"project": {
"ios": {
"sourceDir": "/Users/francoangulo/Documents/MSB/msb-mobile/ios",
"xcodeProject": {
"name": "MyStrengthBook.xcworkspace",
"path": ".",
"isWorkspace": true
},
"assets": []
},
"android": {
"sourceDir": "/Users/francoangulo/Documents/MSB/msb-mobile/android",
"appName": "app",
"packageName": "com.mystrengthbook",
"applicationId": "com.mystrengthbook",
"mainActivity": ".MainActivity",
"assets": []
}
}
}
My autolinking.json file content:
{
"root": "/Users/francoangulo/Documents/MSB/msb-mobile",
"reactNativePath": "/Users/francoangulo/Documents/MSB/msb-mobile/node_modules/react-native",
"reactNativeVersion": "0.81",
"dependencies": {
"react-native-screens": {
"root": "/Users/francoangulo/Documents/MSB/msb-mobile/node_modules/react-native-screens",
"name": "react-native-screens",
"platforms": {
"ios": {
"podspecPath": "/Users/francoangulo/Documents/MSB/msb-mobile/node_modules/react-native-screens/RNScreens.podspec",
"version": "4.17.0",
"configurations": [],
"scriptPhases": []
},
"android": {
"sourceDir": "/Users/francoangulo/Documents/MSB/msb-mobile/node_modules/react-native-screens/android",
"packageImportPath": "import com.swmansion.rnscreens.RNScreensPackage;",
"packageInstance": "new RNScreensPackage()",
"buildTypes": [],
"libraryName": "rnscreens",
"componentDescriptors": [
"RNSFullWindowOverlayComponentDescriptor",
"RNSScreenContainerComponentDescriptor",
"RNSScreenNavigationContainerComponentDescriptor",
"RNSScreenStackHeaderConfigComponentDescriptor",
"RNSScreenStackHeaderSubviewComponentDescriptor",
"RNSScreenStackComponentDescriptor",
"RNSSearchBarComponentDescriptor",
"RNSScreenComponentDescriptor",
"RNSScreenFooterComponentDescriptor",
"RNSScreenContentWrapperComponentDescriptor",
"RNSModalScreenComponentDescriptor",
"RNSBottomTabsComponentDescriptor",
"RNSSafeAreaViewComponentDescriptor"
],
"cmakeListsPath": "/Users/francoangulo/Documents/MSB/msb-mobile/node_modules/react-native-screens/android/src/main/jni/CMakeLists.txt",
"cxxModuleCMakeListsModuleName": null,
"cxxModuleCMakeListsPath": null,
"cxxModuleHeaderName": null,
"isPureCxxDependency": false
}
}
},
},
"commands": [
{
"name": "bundle",
"description": "Build the bundle for the provided JavaScript entry file.",
"options": [
{
"name": "--entry-file <path>",
"description": "Path to the root JS file, either absolute or relative to JS root"
},
{
"name": "--platform <string>",
"description": "Either \"ios\" or \"android\"",
"default": "ios"
},
{
"name": "--transformer <string>",
"description": "Specify a custom transformer to be used"
},
{
"name": "--dev [boolean]",
"description": "If false, warnings are disabled and the bundle is minified",
"default": true
},
{
"name": "--minify [boolean]",
"description": "Allows overriding whether bundle is minified. This defaults to false if dev is true, and true if dev is false. Disabling minification can be useful for speeding up production builds for testing purposes."
},
{
"name": "--bundle-output <string>",
"description": "File name where to store the resulting bundle, ex. /tmp/groups.bundle"
},
{
"name": "--bundle-encoding <string>",
"description": "Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer).",
"default": "utf8"
},
{
"name": "--max-workers <number>",
"description": "Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine."
},
{
"name": "--sourcemap-output <string>",
"description": "File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map"
},
{
"name": "--sourcemap-sources-root <string>",
"description": "Path to make sourcemap's sources entries relative to, ex. /root/dir"
},
{
"name": "--sourcemap-use-absolute-path",
"description": "Report SourceMapURL using its full path",
"default": false
},
{
"name": "--assets-dest <string>",
"description": "Directory name where to store assets referenced in the bundle"
},
{
"name": "--unstable-transform-profile <string>",
"description": "Experimental, transform JS for a specific JS engine. Currently supported: hermes, hermes-canary, default",
"default": "default"
},
{
"name": "--asset-catalog-dest [string]",
"description": "Path where to create an iOS Asset Catalog for images"
},
{
"name": "--reset-cache",
"description": "Removes cached files",
"default": false
},
{
"name": "--read-global-cache",
"description": "Try to fetch transformed JS code from the global cache, if configured.",
"default": false
},
{
"name": "--config <string>",
"description": "Path to the CLI configuration file"
},
{
"name": "--resolver-option <string...>",
"description": "Custom resolver options of the form key=value. URL-encoded. May be specified multiple times."
}
]
},
{
"name": "start",
"description": "Start the React Native development server.",
"options": [
{
"name": "--port <number>"
},
{
"name": "--host <string>",
"default": ""
},
{
"name": "--projectRoot <path>",
"description": "Path to a custom project root"
},
{
"name": "--watchFolders <list>",
"description": "Specify any additional folders to be added to the watch list"
},
{
"name": "--assetPlugins <list>",
"description": "Specify any additional asset plugins to be used by the packager by full filepath"
},
{
"name": "--sourceExts <list>",
"description": "Specify any additional source extensions to be used by the packager"
},
{
"name": "--max-workers <number>",
"description": "Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine."
},
{
"name": "--transformer <string>",
"description": "Specify a custom transformer to be used"
},
{
"name": "--reset-cache, --resetCache",
"description": "Removes cached files"
},
{
"name": "--custom-log-reporter-path, --customLogReporterPath <string>",
"description": "Path to a JavaScript file that exports a log reporter as a replacement for TerminalReporter"
},
{
"name": "--https",
"description": "Enables https connections to the server"
},
{
"name": "--key <path>",
"description": "Path to custom SSL key"
},
{
"name": "--cert <path>",
"description": "Path to custom SSL cert"
},
{
"name": "--config <string>",
"description": "Path to the CLI configuration file"
},
{
"name": "--no-interactive",
"description": "Disables interactive mode"
},
{
"name": "--client-logs",
"description": "[Deprecated] Enable plain text JavaScript log streaming for all connected apps. This feature is deprecated and will be removed in future.",
"default": false
}
]
},
{
"name": "codegen",
"options": [
{
"name": "--path <path>",
"description": "Path to the React Native project root.",
"default": "/Users/francoangulo/Documents/MSB/msb-mobile/ios"
},
{
"name": "--platform <string>",
"description": "Target platform. Supported values: \"android\", \"ios\", \"all\".",
"default": "all"
},
{
"name": "--outputPath <path>",
"description": "Path where generated artifacts will be output to."
},
{
"name": "--source <string>",
"description": "Whether the script is invoked from an `app` or a `library`",
"default": "app"
}
]
},
{
"name": "log-ios",
"description": "starts iOS device syslog tail",
"options": [
{
"name": "-i --interactive",
"description": "Explicitly select simulator to tail logs from. By default it will tail logs from the first booted and available simulator."
}
]
},
{
"name": "run-ios",
"description": "builds your app and starts it on iOS simulator",
"examples": [
{
"desc": "Run on a different simulator, e.g. iPhone SE (2nd generation)",
"cmd": "npx react-native run-ios --simulator \"iPhone SE (2nd generation)\""
},
{
"desc": "Run on a connected device, e.g. Max's iPhone",
"cmd": "npx react-native run-ios --device \"Max's iPhone\""
},
{
"desc": "Run on the AppleTV simulator",
"cmd": "npx react-native run-ios --simulator \"Apple TV\" --scheme \"helloworld-tvOS\""
}
],
"options": [
{
"name": "--no-packager",
"description": "Do not launch packager while running the app"
},
{
"name": "--port <number>",
"default": 8081
},
{
"name": "--terminal <string>",
"description": "Launches the Metro Bundler in a new window using the specified terminal path.",
"default": "Apple_Terminal"
},
{
"name": "--binary-path <string>",
"description": "Path relative to project root where pre-built .app binary lives."
},
{
"name": "--list-devices",
"description": "List all available iOS devices and simulators and let you choose one to run the app. "
},
{
"name": "--udid <string>",
"description": "Explicitly set the device to use by UDID"
},
{
"name": "--simulator <string>",
"description": "Explicitly set the simulator to use. Optionally set the iOS version between parentheses at the end to match an exact version: \"iPhone 15 (17.0)\""
},
{
"name": "--mode <string>",
"description": "Explicitly set the scheme configuration to use. This option is case sensitive."
},
{
"name": "--scheme <string>",
"description": "Explicitly set Xcode scheme to use"
},
{
"name": "--destination <string>",
"description": "Explicitly extend destination e.g. \"arch=x86_64\""
},
{
"name": "--verbose",
"description": "Do not use xcbeautify or xcpretty even if installed"
},
{
"name": "--xcconfig [string]",
"description": "Explicitly set xcconfig to use"
},
{
"name": "--buildFolder <string>",
"description": "Location for iOS build artifacts. Corresponds to Xcode's \"-derivedDataPath\"."
},
{
"name": "--extra-params <string>",
"description": "Custom params that will be passed to xcodebuild command."
},
{
"name": "--target <string>",
"description": "Explicitly set Xcode target to use."
},
{
"name": "-i --interactive",
"description": "Explicitly select which scheme and configuration to use before running a build"
},
{
"name": "--force-pods",
"description": "Force CocoaPods installation"
},
{
"name": "--only-pods",
"description": "Only install Cocoapods, do not build the app"
},
{
"name": "--device [string]",
"description": "Explicitly set the device to use by name or by unique device identifier . If the value is not provided,the app will run on the first available physical device."
}
]
},
{
"name": "build-ios",
"description": "builds your app for iOS platform",
"examples": [
{
"desc": "Build the app for all iOS devices in Release mode",
"cmd": "npx react-native build-ios --mode \"Release\""
}
],
"options": [
{
"name": "--mode <string>",
"description": "Explicitly set the scheme configuration to use. This option is case sensitive."
},
{
"name": "--scheme <string>",
"description": "Explicitly set Xcode scheme to use"
},
{
"name": "--destination <string>",
"description": "Explicitly extend destination e.g. \"arch=x86_64\""
},
{
"name": "--verbose",
"description": "Do not use xcbeautify or xcpretty even if installed"
},
{
"name": "--xcconfig [string]",
"description": "Explicitly set xcconfig to use"
},
{
"name": "--buildFolder <string>",
"description": "Location for iOS build artifacts. Corresponds to Xcode's \"-derivedDataPath\"."
},
{
"name": "--extra-params <string>",
"description": "Custom params that will be passed to xcodebuild command."
},
{
"name": "--target <string>",
"description": "Explicitly set Xcode target to use."
},
{
"name": "-i --interactive",
"description": "Explicitly select which scheme and configuration to use before running a build"
},
{
"name": "--force-pods",
"description": "Force CocoaPods installation"
},
{
"name": "--only-pods",
"description": "Only install Cocoapods, do not build the app"
},
{
"name": "--device [string]",
"description": "Explicitly set the device to use by name or by unique device identifier . If the value is not provided,the app will run on the first available physical device."
}
]
},
{
"name": "log-android",
"description": "starts logkitty"
},
{
"name": "run-android",
"description": "builds your app and starts it on a connected Android emulator or device",
"options": [
{
"name": "--mode <string>",
"description": "Specify your app's build variant"
},
{
"name": "--tasks <list>",
"description": "Run custom Gradle tasks. By default it's \"assembleDebug\". Will override passed mode and variant arguments."
},
{
"name": "--active-arch-only",
"description": "Build native libraries only for the current device architecture for debug builds.",
"default": false
},
{
"name": "--extra-params <string>",
"description": "Custom params passed to gradle build command"
},
{
"name": "-i --interactive",
"description": "Explicitly select build type and flavour to use before running a build"
},
{
"name": "--no-packager",
"description": "Do not launch packager while running the app"
},
{
"name": "--port <number>",
"default": 8081
},
{
"name": "--terminal <string>",
"description": "Launches the Metro Bundler in a new window using the specified terminal path.",
"default": "Apple_Terminal"
},
{
"name": "--appId <string>",
"description": "Specify an applicationId to launch after build. If not specified, `package` from AndroidManifest.xml will be used.",
"default": ""
},
{
"name": "--appIdSuffix <string>",
"description": "Specify an applicationIdSuffix to launch after build.",
"default": ""
},
{
"name": "--main-activity <string>",
"description": "Name of the activity to start"
},
{
"name": "--device <string>",
"description": "Explicitly set the device to use by name. The value is not required if you have a single device connected."
},
{
"name": "--deviceId <string>",
"description": "**DEPRECATED** Builds your app and starts it on a specific device/simulator with the given device id (listed by running \"adb devices\" on the command line)."
},
{
"name": "--list-devices",
"description": "Lists all available Android devices and simulators and let you choose one to run the app",
"default": false
},
{
"name": "--binary-path <string>",
"description": "Path relative to project root where pre-built .apk binary lives."
},
{
"name": "--user <number>",
"description": "Id of the User Profile you want to install the app on."
}
]
},
{
"name": "build-android",
"description": "builds your app",
"options": [
{
"name": "--mode <string>",
"description": "Specify your app's build variant"
},
{
"name": "--tasks <list>",
"description": "Run custom Gradle tasks. By default it's \"assembleDebug\". Will override passed mode and variant arguments."
},
{
"name": "--active-arch-only",
"description": "Build native libraries only for the current device architecture for debug builds.",
"default": false
},
{
"name": "--extra-params <string>",
"description": "Custom params passed to gradle build command"
},
{
"name": "-i --interactive",
"description": "Explicitly select build type and flavour to use before running a build"
}
]
}
],
"healthChecks": [],
"platforms": {
"ios": {},
"android": {}
},
"assets": [
"./src/assets/fonts/"
],
"project": {
"ios": {
"sourceDir": "/Users/francoangulo/Documents/MSB/msb-mobile/ios",
"xcodeProject": {
"name": "MyStrengthBook.xcworkspace",
"path": ".",
"isWorkspace": true
},
"assets": []
},
"android": {
"sourceDir": "/Users/francoangulo/Documents/MSB/msb-mobile/android",
"appName": "app",
"packageName": "com.mystrengthbook",
"applicationId": "com.mystrengthbook",
"mainActivity": ".MainActivity",
"assets": []
}
}
}
Are you using precompiled React Native core? We got this error in multiple libraries, but after disabling RCT_USE_PREBUILT_RNCORE it disappeared.
hey @francoangulo , is this solved? i am facing the exact same issue.
RN version: 0.77.3 react native screens: 4.10.0
@francoangulo i am facing the exact same issue as well.
@dummyorggen-sketch for me it was fixed by adding: prepare_react_native_project! in my podfile
@dummyorggen-sketch for me it was fixed by adding: prepare_react_native_project! in my podfile
Thanks a lot man, it worked.
For now, I've been only able to get this to work using the script in the Podfile I suggested in the opening comment of this thread, but will check again next week with the suggestions you provided guys and will come back with the results
@francoangulo Hi Franco, you mentioned you have a script that is making this work for you, can you please help with please ? i am having the same issue and i have been stuck on it for days
@dummyorggen-sketch for me it was fixed by adding: prepare_react_native_project! in my podfile
it worked. Thanks
@francoangulo Hi Franco, you mentioned you have a script that is making this work for you, can you please help with please ? i am having the same issue and i have been stuck on it for days
Hey buddy! Sorry for the late reply, I just saw this. In the first comment of the thread, the one with which I opened the thread has the script; search for post_install word in this page and you'll find it.
I'm adding it here again for you anyways, your Podfile post_install should look something like this:
post_install do |installer|
react_native_post_install(installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
config[:reactNativePath],
:mac_catalyst_enabled => false,
:ccache_enabled => ENV['USE_CCACHE'] == '1'
)
# Helper method to add Fabric component files to a target
def add_fabric_components(installer, target_name, component_path)
target = installer.pods_project.targets.find { |t| t.name == target_name }
return unless target
fabric_files = ['Props.cpp', 'ShadowNodes.cpp', 'ComponentDescriptors.cpp', 'EventEmitters.cpp', 'States.cpp']
fabric_files.each do |file_name|
file_path = File.join(installer.sandbox.root, "../build/generated/ios/react/renderer/components/#{component_path}/#{file_name}")
if File.exist?(file_path)
file_ref = installer.pods_project.new_file(file_path)
target.source_build_phase.add_file_reference(file_ref)
puts "✅ Added #{file_name} to #{target_name}"
else
puts "⚠️ #{target_name} #{file_name} not found yet (will be generated during build)"
end
end
end
# Fix for Fabric components not being included in various libraries
# Add missing Fabric component files to each target's compile sources
add_fabric_components(installer, 'RNScreens', 'rnscreens')
# this is specific for RNScreens but this works also for other libraries if you are facing the same issue
end
end
Reach me out again if you need further help with this