Skip to content

[iOS] - Undefined symbols for architecture arm64 #3305

@francoangulo

Description

@francoangulo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Missing infoThe user didn't precise the problem enoughMissing reproThis issue need minimum repro scenarioPlatform: iOSThis issue is specific to iOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions