Xcode错误:“/ R.swift / rswift:没有这样的文件或目录”

时间:2017-06-08 15:35:05

标签: swift

收到此错误:

/Users/brendanwinter/Library/Developer/Xcode/DerivedData/Sidearm-bpmbvflilopwujbzzhkazqidiguc/Build/Intermediates/Sidearm.build/Debug-iphonesimulator/louisville.build/Script-52247AC61D89704E005DF2FA.sh: line 2: /R.swift/rswift: No such file or directory

Screenshot 1

我试过了:

  • 重新安装Pod
  • 更新CocoaPods
  • 清除DerivedData文件夹
  • 清洁构建

3 个答案:

答案 0 :(得分:2)

我假设您正在使用R.swift代码生成器(我是合作者)。

如果您使用Cocoapods(installation instructions)进行安装,请确保指向运行脚本中的正确目录:

"$PODS_ROOT/R.swift/rswift" generate "$SRCROOT/R.generated.swift"

请注意此处的$PODS_ROOT,它通常指向项目根目录下的Pods目录。
如果您从运行脚本中排除它,Xcode将无法找到rswift可执行文件。

答案 1 :(得分:1)

检入Podfile。移动

pod 'R.swift' # https://github.com/mac-cain13/R.swift

从目标“您的项目...测试”开始

target 'You project' do

我遇到了疯狂的错误,因此我再次检查了pod文件,然后消失了。

答案 2 :(得分:0)

  target 'You project' do
     pod 'R.swift'

     target 'Other target' # Prevent compile error (add this block resolve my compile error)
  end
相关问题