美文网首页
ReactNative升级0.63.0后Pod isntall失

ReactNative升级0.63.0后Pod isntall失

作者: cvl陈 | 来源:发表于2020-10-09 18:33 被阅读0次

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 代表项目这没啥可说的也就提一嘴

相关文章

网友评论

      本文标题:ReactNative升级0.63.0后Pod isntall失

      本文链接:https://www.haomeiwen.com/subject/vnxrpktx.html