Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Flipper Folly crashes build on x86_64 Mac #3359

Open
wojewski opened this issue Jan 26, 2022 · 13 comments
Open

Flipper Folly crashes build on x86_64 Mac #3359

wojewski opened this issue Jan 26, 2022 · 13 comments

Comments

@wojewski
Copy link

wojewski commented Jan 26, 2022

🐛 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

@ZComwiz
Copy link

ZComwiz commented Jan 27, 2022

Connected to: #3117

@aigoncharov
Copy link
Contributor

CC @lblasa

@wojewski
Copy link
Author

wojewski commented Feb 22, 2022

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)

@jiroscripts
Copy link

Any news on this issue please?

@ZComwiz
Copy link

ZComwiz commented Sep 22, 2022

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

@jiroscripts
Copy link

jiroscripts commented Sep 22, 2022

@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

@ZComwiz
Copy link

ZComwiz commented Sep 22, 2022

@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.

@NJHu
Copy link

NJHu commented Oct 20, 2022

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)

@Watersdr
Copy link

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)

@btkramm
Copy link

btkramm commented Oct 4, 2023

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?

@dimplegarg
Copy link

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

@QDFish
Copy link

QDFish commented Apr 29, 2024

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
Copy link

QDFish commented Apr 29, 2024

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants