8000 react-native 0.62在xcode13遇到build error解决 · Issue #9 · gwl002/gwl002.github.io · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
react-native 0.62在xcode13遇到build error解决 #9
Open
@gwl002

Description

@gwl002

最近为了将app项目发布到ios15版本,升级了xcode到13,遇到几个bug,这里记录解决方案。

1. No matching function for call to 'RCTBridgeModuleNameForClass'

# 在 ios/Podfile 中加入一下代码
def find_and_replace(dir, findstr, replacestr)
    Dir[dir].each do |name|
        text = File.read(name)
        replace = text.gsub(findstr,replacestr)
        if text != replace
            puts "Fix: " + name
            File.open(name, "w") { |file| file.puts replace }
            STDOUT.flush
        end
    end
    Dir[dir + '*/'].each(&method(:find_and_replace))
  end
post_install do |installer|
  ## 以下 Fix for XCode 12.5
    find_and_replace(
    "../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
    "_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", 
    "_initializeModules:(NSArray<Class> *)modules")
    
    find_and_replace(
    "../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm",
    "RCTBridgeModuleNameForClass(strongModule))", 
    "RCTBridgeModuleNameForClass(Class(strongModule)))"
    )
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
      end
    end
  end

2. undefined symbol: _swift_force_load$_swiftfileprovider

rn官方最新解决方案

3. 删除flipper相关代码

相关链接

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0