React Native RCT-FOLLY -当前目标不支持线程本地存储

ijxebb2r  于 2023-02-05  发布在  React
关注(0)|答案(3)|浏览(153)

当我尝试在Xcode中构建我的react-native项目时,我从RCT-Folly得到了这个错误:
{路径}/应用程序/ios/Pod/随机对照试验-愚蠢/愚蠢/容器/详细信息/F14Table.cpp:41:10:当前目标不支持线程本地存储
{路径}/应用程序/ios/Pod/随机对照试验-愚蠢/愚蠢/容器/详细信息/F14Table.cpp:56:10:当前目标不支持线程本地存储
我不是很清楚发生了什么事,所以我不知道我需要提供什么信息,但这里是我的播客文件:

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

我试过:

  • 重新安装:Xcode、node_modules、pod和项目
  • 删除:构建文件夹、DerivedData、package-lock.json、Podfile. lock
aurhwmvo

aurhwmvo1#

我也遇到过同样的问题,以下是我解决问题的方法
https://github.com/tanersener/react-native-ffmpeg/issues/148#issuecomment-633371018

eit6fx6z

eit6fx6z2#

我通过添加以下代码片段解决了这个问题:

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

注:我使用的是RN 0.66.3。

uurity8g

uurity8g3#

另一种解决方法为我解决了这个问题。相同的错误消息Thread-local storage is not supported for the current target来自属于RCT-Folly.cpp文件。Xcode试图为i386构建(不确定为什么)。
(macOS 13.0.1、Xcode 13.4.1、React原生操作系统0.71.0)
1.在Xcode工作区中选择“Pod”项目
1.从目标列表中选择“RCT-愚蠢”
1.转到“构建设置”选项卡
1.在“架构”-〉“排除的架构”下,将i386添加到“任何iOS模拟器SDK”的值中。
i386只适用于iOS 10及更低版本,如果我没有记错的话。

相关问题