skip to Main Content

When I try to build my react-native project in Xcode I get this error from RCT-Folly:

{path}/App/ios/Pods/RCT-Folly/folly/container/detail/F14Table.cpp:41:10: Thread-local storage is not supported for the current target

{path}/App/ios/Pods/RCT-Folly/folly/container/detail/F14Table.cpp:56:10: Thread-local storage is not supported for the current target

I’m not really sure what is going on so im not sure what information I need to provide but here is my Podfile:

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

platform :ios, '11.0'

target 'Aware' do
  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
  )

  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
  pod 'Firebase/AnalyticsWithoutAdIdSupport'
 # pod 'RCT-Folly', :podspec => '../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec'
 # pod 'React-callinvoker"', :podspec => '../node_modules/react-native/ReactCommon/callinvoker.podspec'
   

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

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  #use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
  end
end

I have tried:

  • reinstall: Xcode, node_modules, pod and project
  • deleting: build folder, DerivedData, package-lock.json, Podfile.lock

3

Answers


  1. I solved it by adding the following code snippet:

    require_relative '../node_modules/react-native/scripts/react_native_pods'
    require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
    
    
    platform :ios, '11.0'
    
    target 'intimo_app' do
      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
      )
    
      target 'intimo_appTests' do
        inherit! :complete
        # Pods for testing
      end
    
      # Enables Flipper.
      #
      # Note that if you have use_frameworks! enabled, Flipper will not work and
      # you should disable the next line.
      # use_flipper!()
    
      # add this condition
      post_install do |installer|
        react_native_post_install(installer) # <- add this line
        __apply_Xcode_12_5_M1_post_install_workaround(installer) # <- add this line
      end
    end
    

    Note: I am using RN 0.66.3.

    Login or Signup to reply.
  2. A different workaround solved this problem for me. Same error message Thread-local storage is not supported for the current target coming from a .cpp file belonging to RCT-Folly. Xcode was trying to build for i386 however (not sure why).

    (macOS 13.0.1, Xcode 13.4.1, react-native 0.71.0)

    1. Select the "Pods" project in your Xcode workspace
    2. Select "RCT-Folly" from the list of targets
    3. Go to "Build settings" tab
    4. Under "Architectures" -> "Excluded Architectures", add i386 to the values for "Any iOS Simulator SDK".

    i386 is only relevant for iOS 10 and lower if I’m not mistaken.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search