react-native-pager-view icon indicating copy to clipboard operation
react-native-pager-view copied to clipboard

Undefined symbols for architecture arm64

Open francoangulo opened this issue 3 months ago • 1 comments

So like the title of this issue says, I'm getting Undefined symbols for architecture arm64 error for several RNCView 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::RNCViewPagerProps::RNCViewPagerProps(facebook::react::PropsParserContext const&, facebook::react::RNCViewPagerProps const&, facebook::react::RawProps const&)

Undefined symbol: facebook::react::RNCViewPagerComponentName

Undefined symbol: facebook::react::RNCViewPagerEventEmitter::onPageScroll(facebook::react::RNCViewPagerEventEmitter::OnPageScroll) const

Undefined symbol: facebook::react::RNCViewPagerEventEmitter::onPageSelected(facebook::react::RNCViewPagerEventEmitter::OnPageSelected) const

Undefined symbol: facebook::react::RNCViewPagerEventEmitter::onPageScrollStateChanged(facebook::react::RNCViewPagerEventEmitter::OnPageScrollStateChanged) 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, 'react-native-pager-view', 'pagerview')

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-pager-view v6.9.1

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

francoangulo avatar Oct 17 '25 12:10 francoangulo

New arch only works with version 7.0.0

moonjava2005 avatar Nov 12 '25 23:11 moonjava2005