【问题标题】:impossible to run pod install on React native projet with Xcode 13无法使用 Xcode 13 在 React 本机项目上运行 pod install
【发布时间】:2021-12-19 19:03:10
【问题描述】:

在我的 React-native 项目上运行 pod install 时发生错误。

我升级到 Xcode 13.1 为 iOS 15 构建我的应用程序。

我在 cocoapods github 上发布了一个问题,他们告诉我这是一个 react-native 问题。

有什么想法吗?

我的终端上有这条消息:

Error
URI::InvalidURIError - bad URI(is not URI?): "/Users/sroques/Dropbox/INFOPROGIS/Clients/new tecnilud/appli-tecnilud/node_modules/react-native/third-party-podspecs/Folly.podspec"
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/rfc3986_parser.rb:67:in `split'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/rfc3986_parser.rb:73:in `parse'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/common.rb:234:in `parse'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open-uri.rb:141:in `open_uri'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/external_sources/podspec_source.rb:19:in `block in fetch'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:86:in `titled_section'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/external_sources/podspec_source.rb:11:in `fetch'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:993:in `fetch_external_source'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:972:in `block (2 levels) in fetch_external_sources'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:971:in `each'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:971:in `block in fetch_external_sources'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:970:in `fetch_external_sources'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:117:in `analyze'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:416:in `analyze'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:161:in `install!'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `load'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `<main>'

【问题讨论】:

  • 嗨,@Stéphane ROQUES ~ 欢迎来到堆栈溢出。您可以编辑原始帖子并改进对问题的描述。这样您就不需要在答案部分改进您的问题。 :)
  • 嗨...明白...对不起那个错误...;)

标签: ios react-native cocoapods


【解决方案1】:

抱歉描述不佳。

我尝试从头开始:

git 克隆我的项目

npm 安装

cd ios 吊舱安装

尝试使用 Xcode 13.1 (13A1030d) 存档

我收到了这个错误: /Users/sroques/Dropbox/INFOPROGIS/Clients/new tecnilud/appli-tecnilud/ios/Pods/Pods.xcodeproj iOS 部署目标“IPHONEOS_DEPLOYMENT_TARGET”设置为 8.0,但支持的部署目标版本范围为 9.0 到 15.0。 99.

我将 iOS 部署目标更改为 9.0 并尝试再次存档

我收到了这个错误: xxx/ios/Pods/Headers/Private/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h:1051:5: 'atomic_notify_one' 不可用

我发现了这篇文章: Xcode throws 'atomic_notify_one<unsigned long>' is unavailable

我找不到 use_flipper!({ 'Flipper' => '0.96.0', 'Flipper-Folly' => '~> 2.6', 'Flipper-RSocket' => '~> 1.4' }) ligne on我的 Podfile,但我试图改变它:

def add_flipper_pods!(versions = {})
  versions['Flipper'] ||= '~> 0.33.1'
  versions['DoubleConversion'] ||= '1.1.7'
  versions['Flipper-Folly'] ||= '~> 2.1'
  versions['Flipper-Glog'] ||= '0.3.6'
  versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
  versions['Flipper-RSocket'] ||= '~> 1.0'

到那个:

def add_flipper_pods!(versions = {})
  versions['Flipper'] ||= '~> 0.96.0'
  versions['DoubleConversion'] ||= '1.1.7'
  versions['Flipper-Folly'] ||= '~> 2.6'
  versions['Flipper-Glog'] ||= '0.3.6'
  versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
  versions['Flipper-RSocket'] ||= '~> 1.4'

我尝试存档增益,但出现此错误: XXX/ios/Pods/Headers/Private/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h:1051:5: 'atomic_notify_one' 不可用

我删除了 pods 文件夹和 Podfile.lock

再次尝试安装 pod

尝试再次存档,但出现 3 个错误: XXX/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm:331:34:无法使用“NSArray *”类型的右值初始化“NSArray *”类型的参数

XXX/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm:776:79:无法使用“NSArray *__strong”类型的左值初始化“NSArray *”类型的参数

XXX/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm:827:69:无法使用“NSArray *__strong”类型的左值初始化“NSArray *”类型的参数

我找到了这篇文章:https://developer.apple.com/forums/thread/679043?login=true&page=1#694098022

我按照 Apple 的建议进行了更改,但它并没有解决我的问题。 现在,我收到了回复 Apple 的这些错误:

xxx/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm:671:20:从“NSArray *”分配给“NSArray *”的指针类型不兼容

xxx/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm:673:20:从“NSArray *”分配给“NSArray *”的指针类型不兼容

【讨论】:

  • 我注意到 RCTCxxBridge.mm 文件的最后一个问题通常出现在将 Xcode 11 升级到 Xcode 12 之后。我的问题出现在从 Xcode 12 升级到 Xcode 13 之后。我没有找到我的已解决帖子案例...
【解决方案2】:
   Command
    /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod install
    
    Stack
       CocoaPods : 1.11.2
            Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
        RubyGems : 3.0.3
            Host : macOS 11.6.1 (20G224)
           Xcode : 13.1 (13A1030d)
             Git : git version 2.18.0
    Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
    Repositories : trunk - CDN - https://cdn.cocoapods.org/
    Plugins
    cocoapods-deintegrate : 1.0.5
    cocoapods-plugins     : 1.0.0
    cocoapods-search      : 1.0.1
    cocoapods-stats       : 1.1.0
    cocoapods-trunk       : 1.6.0
    cocoapods-try         : 1.2.0
    Podfile
    platform :ios, '10.0'
    require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
    require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
    
    def add_flipper_pods!(versions = {})
      #versions['Flipper'] ||= '~> 0.33.1'
      versions['Flipper'] ||= '~> 0.87.0'
      versions['DoubleConversion'] ||= '1.1.7'
      #versions['Flipper-Folly'] ||= '~> 2.1'
      versions['Flipper-Folly'] ||= '~>2.5.3'
      versions['Flipper-Glog'] ||= '0.3.6'
      versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
      #versions['Flipper-RSocket'] ||= '~> 1.0'
      versions['Flipper-RSocket'] ||= '~> 1.3.1'
    
      pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug'
      pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug'
      pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
      pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug'
      pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug'
    
      # List all transitive dependencies for FlipperKit pods
      # to avoid them being linked in Release builds
      pod 'Flipper', versions['Flipper'], :configuration => 'Debug'
      pod 'Flipper-DoubleConversion', versions['DoubleConversion'], :configuration => 'Debug'
      pod 'Flipper-Folly', versions['Flipper-Folly'], :configuration => 'Debug'
      pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug'
      pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug'
      pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug'
      pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug'
      pod 'FlipperKit/CppBridge', versions['Flipper'], :configuration => 'Debug'
      pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug'
      pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug'
      pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug'
      pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug'
      pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug'
      pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
    end
    
    # Post Install processing for Flipper
    def flipper_post_install(installer)
      installer.pods_project.targets.each do |target|
        if target.name == 'YogaKit'
          target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '4.1'
          end
        end
      end
    end
    
    target 'Tecniludreporter' do
      # Pods for Tecniludreporter
      pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
      #pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
      pod 'FBReactNativeSpec', :path => "../node_modules/react-native/React/FBReactNativeSpec"
    
      pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
      pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
      pod 'React', :path => '../node_modules/react-native/'
      pod 'React-Core', :path => '../node_modules/react-native/'
      pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
      pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
      pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
      pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
      pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
      pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
      pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
      pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
      pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
      pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
      pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
      pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
    
      pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
      pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
      pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
      pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
      pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
      pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
      pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
    
      pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
      pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
      pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
    
      use_unimodules!
      use_native_modules!
    
      # Enables Flipper.
      #
      # Note that if you have use_frameworks! enabled, Flipper will not work and
      # you should disable these next few lines.
      add_flipper_pods!
      post_install do |installer|
        flipper_post_install(installer)
      end
    end

【讨论】:

  • 你能在这里添加一些解释吗?仅代码的答案通常不受欢迎。
猜你喜欢
  • 2021-12-31
  • 2019-10-05
  • 2021-09-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-10-23
  • 2021-12-21
相关资源
最近更新 更多