flipper icon indicating copy to clipboard operation
flipper copied to clipboard

Flipper Folly crashes build on x86_64 Mac

Open wojewski opened this issue 3 years ago • 13 comments
trafficstars

🐛 Bug Report

After setting up the Flipper in React Native app along with manual config from doc and also by following the Flipper React Native Example. The app crashes on the build phase as follows:

Undefined symbols for architecture x86_64:
  "_make_fcontext", referenced from:
      folly::fibers::FiberImpl::FiberImpl(folly::Function<void ()>, unsigned char*, unsigned long) in Fiber.o
  "folly::detail::crc32c_combine_hw(unsigned int, unsigned int, unsigned long)", referenced from:
      folly::crc32c_combine(unsigned int, unsigned int, unsigned long) in Checksum.o
  "folly::detail::crc32c_combine_sw(unsigned int, unsigned int, unsigned long)", referenced from:
      folly::crc32c_combine(unsigned int, unsigned int, unsigned long) in Checksum.o
  "folly::detail::crc32_combine_hw(unsigned int, unsigned int, unsigned long)", referenced from:
      folly::crc32_combine(unsigned int, unsigned int, unsigned long) in Checksum.o
  "folly::detail::crc32_combine_sw(unsigned int, unsigned int, unsigned long)", referenced from:
      folly::crc32_combine(unsigned int, unsigned int, unsigned long) in Checksum.o
  "_jump_fcontext", referenced from:
      folly::fibers::FiberImpl::deactivate() in Fiber.o
      folly::fibers::FiberImpl::activate() in SimpleLoopController.o
  "folly::detail::crc32c_hw(unsigned char const*, unsigned long, unsigned int)", referenced from:
      folly::crc32c(unsigned char const*, unsigned long, unsigned int) in Checksum.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

To Reproduce

  • Setup Flipper in the Podfile that contains use_frameworks!, below there's mine:
platform :ios, '11.0'

$RNFirebaseAsStaticFramework = true

react_native_path = '../node_modules/react-native'
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

# source 'https://bitbucket.org/authenteq/cocoapods-specs.git'
source 'https://cdn.cocoapods.org/'

target 'App' do
  use_native_modules!
  use_frameworks!

  # Pods for App

  config = use_native_modules!
  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )
  permissions_path = '../node_modules/react-native-permissions/ios'

  pod 'NewRelicAgent'

  pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
  pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
  pod 'Permission-AppTrackingTransparency', :path => "#{permissions_path}/AppTrackingTransparency"

  target 'AppTests' do
    inherit! :complete
    # Pods for testing
  end
end

target "AirshipNotificationServiceExtension" do
  use_frameworks!
  pod 'AirshipExtensions/NotificationService'
end

$static_framework = ['RNScreens', 'RNPermissions', 'Permission-PhotoLibrary', 'Permission-AppTrackingTransparency', 'Permission-Camera']
pre_install do |installer|
  Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
  installer.pod_targets.each do |pod|
    if $static_framework.include?(pod.name)
      puts "Overriding the static_framework method for #{pod.name}"
      def pod.build_type;
        Pod::BuildType.static_library
      end
    end
  end
end

use_flipper!({'Flipper' => '0.129.0'})

post_install do |installer|
  react_native_post_install(installer)
  flipper_post_install(installer)

  installer.aggregate_targets.each do |aggregate_target|
    aggregate_target.user_project.native_targets.each do |target|
      target.build_configurations.each do |config|
        # Arch selection is needed to work across M1/Intel macs, became necessary when App Check was added
        config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
        config.build_settings['EXCLUDED_ARCHS'] = 'i386'
      end
    end
    aggregate_target.user_project.save
  end

  __apply_Xcode_12_5_M1_post_install_workaround(installer)
end

  • Install pods
  • Build React Native App

Environment

Flipper desktop version: tried on both: 0.58.0 and 0.129.0 React Native version: tried on both: 0.66.3 and 0.67.1 Hermes: disabled System: Mac x86_64

wojewski avatar Jan 26 '22 15:01 wojewski

Connected to: https://github.com/facebook/flipper/issues/3117

ZComwiz avatar Jan 27 '22 04:01 ZComwiz

CC @lblasa

fxlrnrpt avatar Feb 10 '22 19:02 fxlrnrpt

I've just tested on arm64, M1 mac and got the same error

Undefined symbols for architecture arm64:
  "_make_fcontext", referenced from:
      folly::fibers::FiberImpl::FiberImpl(folly::Function<void ()>, unsigned char*, unsigned long) in Fiber.o
  "folly::detail::crc32c_combine_hw(unsigned int, unsigned int, unsigned long)", referenced from:
      folly::crc32c_combine(unsigned int, unsigned int, unsigned long) in Checksum.o
  "folly::detail::crc32c_combine_sw(unsigned int, unsigned int, unsigned long)", referenced from:
      folly::crc32c_combine(unsigned int, unsigned int, unsigned long) in Checksum.o
  "folly::detail::crc32_combine_hw(unsigned int, unsigned int, unsigned long)", referenced from:
      folly::crc32_combine(unsigned int, unsigned int, unsigned long) in Checksum.o
  "folly::detail::crc32_combine_sw(unsigned int, unsigned int, unsigned long)", referenced from:
      folly::crc32_combine(unsigned int, unsigned int, unsigned long) in Checksum.o
  "_jump_fcontext", referenced from:
      folly::fibers::FiberImpl::deactivate() in Fiber.o
      folly::fibers::FiberImpl::activate() in SimpleLoopController.o
  "folly::detail::crc32c_hw(unsigned char const*, unsigned long, unsigned int)", referenced from:
      folly::crc32c(unsigned char const*, unsigned long, unsigned int) in Checksum.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

wojewski avatar Feb 22 '22 15:02 wojewski

Any news on this issue please?

jiroscripts avatar Sep 22 '22 14:09 jiroscripts

@thibaultcapelli what is your build setup? In what capacity are you using Flipper?

ZComwiz avatar Sep 22 '22 15:09 ZComwiz

@thibaultcapelli what is your build setup? In what capacity are you using Flipper?

I'm making a migration to RN 0.69.5. I'm using a M1. If I disable Flutter in the Profile I can bypass this error

I have exactly the same error than @wojewski. I can't test with an Intel processor for now

jiroscripts avatar Sep 22 '22 18:09 jiroscripts

@thibaultcapelli — according to the release notes, RN .70 should support Mac Catalyst. Haven't gotten through removing all PropTypes yet to find out. For now we remove Flipper reference for Mac Catalyst from Podfile. No errors when building to the other device types/simulators with Flipper enabled.

ZComwiz avatar Sep 22 '22 20:09 ZComwiz

Undefined symbols for architecture arm64: "_make_fcontext", referenced from: folly::fibers::FiberImpl::FiberImpl(folly::Function<void ()>, unsigned char*, unsigned long) in Fiber.o "folly::detail::crc32c_combine_hw(unsigned int, unsigned int, unsigned long)", referenced from: folly::crc32c_combine(unsigned int, unsigned int, unsigned long) in Checksum.o "folly::detail::crc32c_combine_sw(unsigned int, unsigned int, unsigned long)", referenced from: folly::crc32c_combine(unsigned int, unsigned int, unsigned long) in Checksum.o "folly::detail::crc32_combine_hw(unsigned int, unsigned int, unsigned long)", referenced from: folly::crc32_combine(unsigned int, unsigned int, unsigned long) in Checksum.o "folly::detail::crc32_combine_sw(unsigned int, unsigned int, unsigned long)", referenced from: folly::crc32_combine(unsigned int, unsigned int, unsigned long) in Checksum.o "_jump_fcontext", referenced from: folly::fibers::FiberImpl::deactivate() in Fiber.o folly::fibers::FiberImpl::activate() in SimpleLoopController.o "folly::detail::crc32c_hw(unsigned char const*, unsigned long, unsigned int)", referenced from: folly::crc32c(unsigned char const*, unsigned long, unsigned int) in Checksum.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

NJHu avatar Oct 20 '22 15:10 NJHu

Anyone have any clues on a fix for this? 😩 I also get a similar one:

Undefined symbols for architecture x86_64:
  "_jump_fcontext", referenced from:
      folly::fibers::FiberImpl::deactivate() in libRCT-Folly.a(Fiber.o)
      folly::fibers::FiberImpl::activate() in libRCT-Folly.a(SimpleLoopController.o)

Watersdr avatar Oct 28 '22 03:10 Watersdr

Anyone have any clues on a fix for this? 😩 I also get a similar one:

Undefined symbols for architecture x86_64:
  "_jump_fcontext", referenced from:
      folly::fibers::FiberImpl::deactivate() in libRCT-Folly.a(Fiber.o)
      folly::fibers::FiberImpl::activate() in libRCT-Folly.a(SimpleLoopController.o)

I have the same issue when using Hermes on iOS. Did you solve it?

btkramm avatar Oct 04 '23 16:10 btkramm

Anyone have any clues on a fix for this? 😩 I also get a similar one: Screenshot 2024-03-29 at 1 31 15 PM

dimplegarg avatar Mar 29 '24 08:03 dimplegarg

Anyone have any clues on a fix for this? 😩 I also get a similar one: Screenshot 2024-03-29 at 1 31 15 PM

did you enable fliper?

QDFish avatar Apr 29 '24 05:04 QDFish

@dimplegarg @btkramm @Watersdr you can delete the 'all_load' in the OTHER_LDFLAG of your main project target to solve this problem

QDFish avatar Apr 29 '24 06:04 QDFish