react native run ios仅在安装POD后第一次运行

react native run ios仅在安装POD后第一次运行,ios,xcode,react-native,cocoapods,Ios,Xcode,React Native,Cocoapods,每次我想在iphone模拟器上启动我的应用程序时,我都必须遵循以下指南: 我以前没有任何问题,但自从我开始使用豆荚后,这个问题就出现了 第一次运行react native run ios时,它会工作。但第二次尝试运行时失败如下: project 'MyApp.xcodeproj' # Uncomment the next line to define a global platform for your project platform :ios, '10.0' # Allowed sour

每次我想在iphone模拟器上启动我的应用程序时,我都必须遵循以下指南:

我以前没有任何问题,但自从我开始使用豆荚后,这个问题就出现了

第一次运行
react native run ios
时,它会工作。但第二次尝试运行时失败如下:

project 'MyApp.xcodeproj'

# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'

# Allowed sources
source 'https://github.com/CocoaPods/Specs.git'

target 'myapp' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for myapp

  # Point to the installed version
  pod 'RNDateTimePicker', :path => '../node_modules/@react-native-community/datetimepicker/RNDateTimePicker.podspec'

  # React/React-Native specific pods
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge',      # Include this for RN >= 0.47
    'DevSupport',     # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket',   # Needed for debugging
  ]

  # Explicitly include Yoga if you are using RN >= 0.42.0
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  # Third party deps podspec link
  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'

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

  target 'myappTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

无法生成iOS项目时出错。我们运行了“xcodebuild”命令,但它退出了,错误代码为65。要进一步调试构建日志,可以考虑用Xcode.app打开应用程序,通过打开KiRAPuiStuppApp.xCWorkStudio

如果我从xcode运行它,它会失败如下:

project 'MyApp.xcodeproj'

# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'

# Allowed sources
source 'https://github.com/CocoaPods/Specs.git'

target 'myapp' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for myapp

  # Point to the installed version
  pod 'RNDateTimePicker', :path => '../node_modules/@react-native-community/datetimepicker/RNDateTimePicker.podspec'

  # React/React-Native specific pods
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge',      # Include this for RN >= 0.47
    'DevSupport',     # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket',   # Needed for debugging
  ]

  # Explicitly include Yoga if you are using RN >= 0.42.0
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  # Third party deps podspec link
  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'

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

  target 'myappTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

ld:找不到-lDoubleConversion的库

但在xcode中,如果我以myApp.xcworkspace的形式打开我的应用程序,那么构建就会成功。问题是我不能通过xcode开发,我需要react native run ios命令才能工作

我的Pods文件如下所示:

project 'MyApp.xcodeproj'

# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'

# Allowed sources
source 'https://github.com/CocoaPods/Specs.git'

target 'myapp' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for myapp

  # Point to the installed version
  pod 'RNDateTimePicker', :path => '../node_modules/@react-native-community/datetimepicker/RNDateTimePicker.podspec'

  # React/React-Native specific pods
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge',      # Include this for RN >= 0.47
    'DevSupport',     # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket',   # Needed for debugging
  ]

  # Explicitly include Yoga if you are using RN >= 0.42.0
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  # Third party deps podspec link
  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'

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

  target 'myappTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

问题是,每次我发出基本dev命令时,如何让应用程序工作

react-native run-ios

我的react本机版本:0.59.10

能够通过将xcode中的构建模式设置为传统模式来修复此问题:

文件->工作区设置->生成系统->旧版生成系统

在此之后,每次运行:
react native run ios

但由于苹果将很快删除遗留的构建系统,我认为这不是一个好的长期解决方案。如果有人想出一个合适的解决办法,我可能会接受