React-Native IOS构建在pod安装上给出错误。

时间:2020-10-27 10:20:07

标签: ios xcode react-native build

我是学习react-native的新手,我想生成一个ios版本,但是每当我尝试运行pod install时,它都会一直给我这个错误。我无法弄清楚哪里错了,我尝试了几种选择,但没有成功。如果有人可以告诉我问题出在哪里,那将是很大的帮助。


EOF

# Prepare exported header include
EXPORTED_INCLUDE_DIR="exported/glog"
mkdir -p exported/glog
cp -f src/glog/log_severity.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/raw_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/stl_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/vlog_is_on.h "$EXPORTED_INCLUDE_DIR/"

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-apple-darwin-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for arm-apple-darwin-gcc... /Library/Developer/CommandLineTools/usr/bin/cc -arch armv7 -isysroot
checking whether the C compiler works... no
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'
/Users/shehzad/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6/missing: Unknown `--is-lightweight' option
Try `/Users/shehzad/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/Users/shehzad/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6':
configure: error: C compiler cannot create executables
See `config.log' for more details


[!] `xcodeproj` was renamed to `project`. Please update your Podfile accordingly.

[!] `<PBXResourcesBuildPhase UUID=`13B07F8E1A680F5B00A75B9A`>` attempted to initialize an object with an unknown UUID. `DC1D7AC84A2642079DCCD9FF` for attribute: `files`. This can be the result of a merge and the unknown UUID is being discarded.

我的Pod文件

my pod file

这是我的ios项目结构

here is my ios project structure

2 个答案:

答案 0 :(得分:1)

如果你不使用鳍状肢命令方块,请注释掉它。


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

platform :ios, '10.0'

target 'studypal' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  target 'studypalTests' 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 'studypal-tvOS' do
  # Pods for RnDiffApp-tvOS

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

然后再次尝试运行 pod install

<块引用>

cd ios

<块引用>

pod 安装

这每次都对我有用

答案 1 :(得分:0)

似乎您添加了xcodeproj属性,这导致崩溃。刚摆脱那条线。

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

platform :ios, '10.0'

target 'studypal' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  target 'studypalTests' 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 'studypal-tvOS' do
  # Pods for RnDiffApp-tvOS

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