代码之家  ›  专栏  ›  技术社区  ›  Karl Taylor Sobol Roman

使用CocoaPods捆绑React本机iOS应用程序时出现问题

  •  0
  • Karl Taylor Sobol Roman  · 技术社区  · 5 年前

    我正在使用 https://github.com/invertase/react-native-firebase 它建议最好的安装方式是通过CocoaPods,然而,当我尝试归档我的应用程序时,我遇到了10000个问题,一个接一个。

    我想知道使用React Native和Cocoapods时的最佳实践是什么,如何导入/加载内容,以及Cocoapods是否真正影响了我的应用程序。

    我最终达到了这一步,它在模拟器中运行,但是我不确定是否需要我对我的系统中不同吊舱的所有引用,即使我可能通过 npm install .

    如果有任何建议,我都会非常感激,因为我想放弃CoCoapod,尝试从头开始安装。

    # Uncomment the next line to define a global platform for your project
    platform :ios, '9.0'
    
    target 'myApp' do
      # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
      # use_frameworks!
    
      # Pods for myApp
      pod 'Firebase/Core'
      pod 'Firebase/Auth'
    
      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'
    
      # Add yoga.
      # https://github.com/facebook/react-native/issues/13046#issuecomment-350523190
      pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
    
      # Set React to be from node_modules.
      pod 'React', :path => '../node_modules/react-native'
      pod 'React', :path => '../node_modules/react-native', :subspecs => [
        'Core',
        'DevSupport',
        'CxxBridge',
        'RCTNetwork',
      ]
    
      target 'myApp-tvOSTests' do
        inherit! :search_paths
        # Pods for testing
        # pod 'react-native-video', :path => '../node_modules/react-native-video'
    
        pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
    
        pod 'SentryReactNative', :path => '../node_modules/react-native-sentry'
    
        pod 'react-native-in-app-utils', :path => '../node_modules/react-native-in-app-utils'
    
        pod 'react-native-camera', :path => '../node_modules/react-native-camera'
    
        pod 'RNIap', :path => '../node_modules/react-native-iap'
    
        # pod 'RNShare', :path => '../node_modules/react-native-share'
    
        pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
    
      end
    
      target 'myApp' do
        inherit! :search_paths
        # Pods for testing
      end
    
      post_install do |installer|
        installer.pods_project.targets.each do |target|
          if target.name == "React"
            target.remove_from_project
          end
        end
      end
    
    end
    
    
    0 回复  |  直到 5 年前
        1
  •  0
  •   Karl Taylor Sobol Roman    5 年前

    答案是一个响亮的大问题 .椰子荚 导致本机应用程序出现问题。

    在评论完其他大部分豆荚后。我的应用程序在第一次尝试时构建良好,并上传到应用商店。

    我的建议。如果不需要的话,不要在椰子荚中添加东西。

    # Uncomment the next line to define a global platform for your project
    platform :ios, '9.0'
    
    target 'myApp' do
      # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
      # use_frameworks!
    
      # Pods for myApp
      pod 'Firebase/Core'
      pod 'Firebase/Auth'
    
      # 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'
    
      # Add yoga.
      # https://github.com/facebook/react-native/issues/13046#issuecomment-350523190
      # pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
    
      # # Set React to be from node_modules.
      # pod 'React', :path => '../node_modules/react-native', :subspecs => [
      #   'Core',
      #   'DevSupport',
      #   'CxxBridge',
      #   'RCTNetwork',
      # ]
    
      target 'myApp-tvOSTests' do
        inherit! :search_paths
        # Pods for testing
        # pod 'react-native-video', :path => '../node_modules/react-native-video'
    
        # pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
    
        # pod 'SentryReactNative', :path => '../node_modules/react-native-sentry'
    
        # pod 'react-native-in-app-utils', :path => '../node_modules/react-native-in-app-utils'
    
        # pod 'react-native-camera', :path => '../node_modules/react-native-camera'
    
        # pod 'RNIap', :path => '../node_modules/react-native-iap'
    
        # pod 'RNShare', :path => '../node_modules/react-native-share'
    
        # pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
    
      end
    
      target 'myApp' do
        inherit! :search_paths
        # Pods for testing
      end
    
      post_install do |installer|
        installer.pods_project.targets.each do |target|
          if target.name == "React"
            target.remove_from_project
          end
        end
      end
    
    end