【问题标题】:Cannot build iOS App on Xcode after upgrade to RN 0.66 and Xcode 13 'gtest/gtest.h' file not found升级到 RN 0.66 和 Xcode 13 'gtest/gtest.h' 文件后无法在 Xcode 上构建 iOS 应用程序
【发布时间】:2021-12-18 01:41:21
【问题描述】:

在将 RN 从 0.61.5 升级到 0.66 并将 Xcode 从 12 更新到 13 之后,我无法构建 iOS 应用程序。

我的 pod 文件是:

platform :ios, '11.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'strongauthappreact' do
  # Pods for strongauthappreact
  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 'boost', :podspec => '../node_modules/react-native/third-party-podspecs/boost.podspec'
  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/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'React-callinvoker', :path => "../node_modules/react-native/ReactCommon/callinvoker"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  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'
  pod 'RCT-Folly', :podspec => '../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec'
  pod 'React-perflogger', :podspec => '../node_modules/react-native/ReactCommon/reactperflogger'
  pod 'React-logger', :podspec => '../node_modules/react-native/ReactCommon/logger'

  pod 'React-runtimeexecutor', :podspec => '../node_modules/react-native/ReactCommon/runtimeexecutor'

  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"

  pod 'RNI18n', :path => '../node_modules/react-native-i18n'

  pod 'react-native-randombytes', :path => '../node_modules/react-native-randombytes'

  pod 'jail-monkey', :path => '../node_modules/jail-monkey'

  pod 'react-native-config', :path => '../node_modules/react-native-config'

  pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'

  pod 'RNExitApp', :path => '../node_modules/react-native-exit-app'

  pod 'react-native-sqlite-storage', :path => '../node_modules/react-native-sqlite-storage'

  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
  
  pod 'TrustKit'

  pod 'Folly-GTest', '~> 1.10'

  pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'

  use_native_modules!
end

我得到的错误是:

'gtest/gtest.h' 文件未找到

从那里:

我尝试重置 Metro 缓存、清理 $TMPDIR、rm node_modules、rm Pods、重新安装所有、清理 Xcode 中的构建缓存,但我仍然卡在这里。

我该如何解决?

【问题讨论】:

  • 对此有何发现?有同样的问题

标签: ios react-native cocoapods googletest


【解决方案1】:

尝试替换

pod 'React-perflogger', :podspec => '../node_modules/react-native/ReactCommon/reactperflogger'
pod 'React-logger', :podspec => '../node_modules/react-native/ReactCommon/logger'
pod 'React-runtimeexecutor', :podspec => '../node_modules/react-native/ReactCommon/runtimeexecutor'

pod 'React-perflogger', :path => '../node_modules/react-native/ReactCommon/reactperflogger'
pod 'React-logger', :path => '../node_modules/react-native/ReactCommon/logger'
pod 'React-runtimeexecutor', :path => '../node_modules/react-native/ReactCommon/runtimeexecutor'

并重新安装 pod。它帮助了我。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-18
    • 1970-01-01
    • 2012-03-27
    • 2018-03-02
    • 1970-01-01
    • 2021-01-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多