ReactNative升级0.63.0后Pod isntall失败解决方法

ReactNative升级0.63.0后项目变更

自从ReactNative升级到0.63.0后,大多数人会遇到iOS项目pod 失败,原因是node_modules内很多依赖变更导致pod install 失败无法pod 依赖文件,而解决办法便是 删除原有podfile,因为ReactNative现在改为动态配置pod
重新创建新的podfile
添加以下代码就即可

require_relative '../node_modules/react-native/scripts/react_native_pods'
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])

另外0.63.0也放弃了对iOS 9的支持
删除Pods文件夹 及podfile.lock 和.xcworkspace 文件
重新pod install
怎么样有没有很方便

下面贴一下本人项目的podfile文件内代码,望有助

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

platform :ios, '10.0'

target 'XXXX' do
  config = use_native_modules!
  use_react_native!(:path => config["reactNativePath"])

  target 'XXXXTests' 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 these next few lines.
  use_flipper!
  post_install do |installer|
    flipper_post_install(installer)
  end
end

target 'XXXX-tvOS' do
  # Pods for XXXX-tvOS

  target 'XXXX-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

XXXX 代表项目这没啥可说的也就提一嘴

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容