无法打开文件(在项目“Pods”中的目标“React”中)(在目标“React”中)

5
我有一个 React Native 项目,正在尝试在最新的 Xcode 10.1 中运行。但是在构建时出现两个错误。 错误:
Users/ios/Pods/Target Support Files/React/React.xcconfig: unable to open file (in target "React" in project "Pods") (in target 'React')

Users/ios/Pods/Target Support Files/React/React.xcconfig: unable to open file (in target "React" in project "Pods") (in target 'React')

我的Podfile文件如下:

 source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'

EXPO_CPP_HEADER_DIR = 'ExpoKit'

target 'commonalityre' do
  pod 'ExpoKit',
    :git => "http://github.com/expo/expo.git",
    :tag => "ios/2.6.8",
    :subspecs => [
      "Core",
      "CPP",
      "GL"
    ],
    :inhibit_warnings => true

  pod 'React',
    :path => "../node_modules/react-native",
    :inhibit_warnings => true,
    :subspecs => [
      "Core",
      "ART",
      "RCTActionSheet",
      "RCTAnimation",
      "RCTCameraRoll",
      "RCTGeolocation",
      "RCTImage",
      "RCTNetwork",
      "RCTPushNotification",
      "RCTText",
      "RCTVibration",
      "RCTWebSocket",
      "DevSupport",
      "CxxBridge"
    ]
  pod 'yoga',
    :path => "../node_modules/react-native/ReactCommon/yoga",
    :inhibit_warnings => true

不确定如何解决这个问题。我尝试删除派生数据和清理,但仍然无法解决这个错误。

谢谢


我猜你只有你的iOS文件夹。你需要你的节点模块文件夹。它的引用在pod里面。 - spike04
1个回答

13

以下方法应该有效:

1.

rm -rf ~/Library/Developer/Xcode/DerivedData

2.

=>

2.

rm -rf node_modules && rm -rf ios/build/* && rm -rf android/build/* && rm -rf $TMPDIR/react-* && yarn cache clean && rm -rf /tmp/haste-map-react-native-packager-* && yarn

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接