react-native run-ios在复制时失败,报错:<mypath>没有这样的文件或目录

时间:2019-02-28 14:53:17

标签: react-native react-native-ios

当我从命令行运行react-native run-ios时,我的构建会在Copying阶段失败,并出现错误;

error: /Users/Brad/Documents/reefbuddy/ios/ios: No such file or directory

我的项目目录结构;

- reefbuddy   
  - ios
    - build
      - Build
        - Products
          reefbuddy.app
  -reefbuddy
    AppDelegate.h
    Appdelegate.m
  reefbuddy.xcodeproj
  reefbuddy.xcworkspace

完整的终端输出的屏幕快照; terminal error message

反应本机环境信息:

System:
  OS: macOS 10.14
  CPU: (4) x64 Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz
  Memory: 243.36 MB / 8.00 GB
  Shell: 3.2.57 - /bin/bash
Binaries:
  Node: 8.11.2 - ~/.nvm/versions/node/v8.11.2/bin/node
  Yarn: 1.6.0 - /usr/local/bin/yarn
  npm: 6.7.0 - ~/.npm-packages/bin/npm
  Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
  iOS SDK:
    Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
  Android SDK:
    API Levels: 25
IDEs:
  Android Studio: 3.1 AI-173.4720617
  Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
  react: 16.6.3 => 16.6.3 
  react-native: 0.58.5 => 0.58.5 
npmGlobalPackages:
  react-native-cli: 2.0.1
  react-native-git-upgrade: 0.2.7

路径的ios/ios部分似乎是错误的,但我不知道这是否正确或如何更改。

根据建议从Xcode进行构建失败,并出现以下错误; enter image description here

与在Xcode corrupts project.pbxproj everytime I try to build with Xcode post上报告的错误相同

1 个答案:

答案 0 :(得分:0)

在Xcode中将目标的路径设置为“绝对”而不是“相对”会解决该问题。