Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native 0.62在xcode13遇到build error解决 #9

Open
gwl002 opened this issue Sep 8, 2021 · 0 comments
Open

react-native 0.62在xcode13遇到build error解决 #9

gwl002 opened this issue Sep 8, 2021 · 0 comments

Comments

@gwl002
Copy link
Owner

gwl002 commented Sep 8, 2021

最近为了将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相关代码

相关链接

@gwl002 gwl002 changed the title react-native 0.62在xcode13遇到debug解决 react-native 0.62在xcode13遇到build error解决 Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant