安装带有react native集成的pod时出错-

问题描述 投票:0回答:2

安装Pod时出错:

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... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for arm-apple-darwin-gcc... /Applications/Xcode 11.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode 11.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk
checking whether the C compiler works... no
/Users/kjunejha/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-1f3da/missing: Unknown `--is-lightweight' option
Try `/Users/kjunejha/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-1f3da/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/Users/kjunejha/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-1f3da':
**configure: error: C compiler cannot create executables**
See `config.log' for more details

**这是我的Podfile:**



platform :ios, '10.0'

    require_relative '../node_modules/react-native-unimodules/cocoapods'
    require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

    target 'RNGuide' do
      rnPrefix = "../node_modules/react-native"

      # React Native and its dependencies
      pod 'FBLazyVector', :path => "#{rnPrefix}/Libraries/FBLazyVector"
      pod 'FBReactNativeSpec', :path => "#{rnPrefix}/Libraries/FBReactNativeSpec"
      pod 'RCTRequired', :path => "#{rnPrefix}/Libraries/RCTRequired"
      pod 'RCTTypeSafety', :path => "#{rnPrefix}/Libraries/TypeSafety"
      pod 'React', :path => "#{rnPrefix}/"
      pod 'React-Core', :path => "#{rnPrefix}/"
      pod 'React-CoreModules', :path => "#{rnPrefix}/React/CoreModules"
      pod 'React-RCTActionSheet', :path => "#{rnPrefix}/Libraries/ActionSheetIOS"
      pod 'React-RCTAnimation', :path => "#{rnPrefix}/Libraries/NativeAnimation"
      pod 'React-RCTBlob', :path => "#{rnPrefix}/Libraries/Blob"
      pod 'React-RCTImage', :path => "#{rnPrefix}/Libraries/Image"
      pod 'React-RCTLinking', :path => "#{rnPrefix}/Libraries/LinkingIOS"
      pod 'React-RCTNetwork', :path => "#{rnPrefix}/Libraries/Network"
      pod 'React-RCTSettings', :path => "#{rnPrefix}/Libraries/Settings"
      pod 'React-RCTText', :path => "#{rnPrefix}/Libraries/Text"
      pod 'React-RCTVibration', :path => "#{rnPrefix}/Libraries/Vibration"
      pod 'React-Core/RCTWebSocket', :path => "#{rnPrefix}/"
      pod 'React-Core/DevSupport', :path => "#{rnPrefix}/"
      pod 'React-cxxreact', :path => "#{rnPrefix}/ReactCommon/cxxreact"
      pod 'React-jsi', :path => "#{rnPrefix}/ReactCommon/jsi"
      pod 'React-jsiexecutor', :path => "#{rnPrefix}/ReactCommon/jsiexecutor"
      pod 'React-jsinspector', :path => "#{rnPrefix}/ReactCommon/jsinspector"

      pod 'ReactCommon/callinvoker', :path => "#{rnPrefix}/ReactCommon"
      pod 'ReactCommon/turbomodule/core', :path => "#{rnPrefix}/ReactCommon"
      pod 'Yoga', :path => "#{rnPrefix}/ReactCommon/yoga"
      pod 'DoubleConversion', :podspec => "#{rnPrefix}/third-party-podspecs/DoubleConversion.podspec"
      pod 'glog', :podspec => "#{rnPrefix}/third-party-podspecs/glog.podspec"
      pod 'Folly', :podspec => "#{rnPrefix}/third-party-podspecs/Folly.podspec"

      # Other native modules

      # Automatically detect installed unimodules
      use_unimodules!

      # react-native-cli autolinking
      use_native_modules!
    end


我正在使用Xcode 11.3.1在Mac OS Mojave -10.14.6上运行

ios react-native cocoapods macos-mojave xcode11.3
2个回答
0
投票

希望此命令行对您有所帮助

cd ios; rm -rf Pods Podfile.lock; pod install; cd ..

0
投票

我的Xcode被命名为“ Xcode 11”。我必须删除Xcode名称中的空格,然后运行sudo xcode-select --switch /Applications/Xcode11.app

然后运行pod安装。它有效!

© www.soinside.com 2019 - 2024. All rights reserved.