• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

修复ReactNative 0.63.4 Xcode编译不用过

武飞扬头像
执念(⊙o⊙)…
帮助5

Flipper-Folly插件报错:

修改 Podfile

  1.  
    require_relative '../node_modules/react-native/scripts/react_native_pods'
  2.  
    require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
  3.  
     
  4.  
    platform :ios, '10.0'
  5.  
     
  6.  
    # 增加此方法,兼容最新的Xcode不兼容问题
  7.  
    def find_and_replace(dir, findstr, replacestr)
  8.  
    Dir[dir].each do |name|
  9.  
    text = File.read(name)
  10.  
    replace = text.gsub(findstr,replacestr)
  11.  
    if text != replace
  12.  
    puts "Fix: " name
  13.  
    File.open(name, "w") { |file| file.puts replace }
  14.  
    STDOUT.flush
  15.  
    end
  16.  
    end
  17.  
    Dir[dir '*/'].each(&method(:find_and_replace))
  18.  
    end
  19.  
     
  20.  
    target 'zjReportApp' do
  21.  
    config = use_native_modules!
  22.  
     
  23.  
    use_react_native!(:path => config["reactNativePath"])
  24.  
     
  25.  
    target 'zjReportAppTests' do
  26.  
    inherit! :complete
  27.  
    # Pods for testing
  28.  
    end
  29.  
     
  30.  
    # Enables Flipper.
  31.  
    #
  32.  
    # Note that if you have use_frameworks! enabled, Flipper will not work and
  33.  
    # you should disable these next few lines.
  34.  
    # 修复ReactNative 0.63.4 Flipper-Folly Xcode 编译不通过问题
  35.  
    use_flipper!({ 'Flipper-Folly' => '2.3.0' })
  36.  
    post_install do |installer|
  37.  
    flipper_post_install(installer)
  38.  
     
  39.  
    find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h",
  40.  
    "atomic_notify_one(state)", "folly::atomic_notify_one(state)")
  41.  
     
  42.  
    find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h",
  43.  
    "atomic_wait_until(&state, previous | data, deadline)", "folly::atomic_wait_until(&state, previous | data, deadline)")
  44.  
    end
  45.  
    end
  46.  
     
  47.  
    target 'zjReportApp-tvOS' do
  48.  
    # Pods for zjReportApp-tvOS
  49.  
     
  50.  
    target 'zjReportApp-tvOSTests' do
  51.  
    inherit! :search_paths
  52.  
    # Pods for testing
  53.  
    end
  54.  
    end
  55.  
     
  56.  
     
学新通

编译测试通过!

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhfhckge
系列文章
更多 icon
同类精品
更多 icon
继续加载