33

Xcode 10 produces this warning when running xcodebuild in a run script phase of a build target. I do this to produce the binary for the other platform (simulator/real device) to lipo into a fat binary for distribution. The warning is produced for every file in the target intermediates directory, for example:

warning: Stale file '/Users/nick/Library/Developer/Xcode/DerivedData/App-ctjxvxdmomwoobfgvvasfhwvcnhy/Build/Intermediates.noindex/Library-Target.build/Debug-iphonesimulator/Sub-Library-Target.build/Objects-normal/i386/Sub-Library-Class.o' is located outside of the allowed root paths.

What are the root paths? Why is this warning produced? Is there any way I can resolve or suppress it?

Nick
  • 3,958
  • 4
  • 32
  • 47
  • I'm getting the same error building a Contacts.app plugin for macOS 10.14.0 in Xcode 10.0; it should copy the plugin bundle to /~/Library/Address Book Plug-Ins/, but I get this error instead. I'm sure it's connected to the improved security of Mojave, but still, I have to find a way to work around it... – cdf1982 Oct 01 '18 at 03:50
  • Did you guys figure something out? – 3lil636wm Feb 25 '19 at 20:11
  • I realised I didn't need to run xcodebuild in my build phase so I removed it. I don't have a solution to the problem, sorry – Nick Feb 26 '19 at 15:48

3 Answers3

43

I had it on Xcode 11.2

solved it by 1. Clean (Cmd+Shift+K) and then:

Cmd+Shift+R ( build for Running )

DanielSmurts
  • 593
  • 5
  • 13
1

For some reason you might have copied the .framework to an external path. To solve this annoying warning you should run (as sudo) the command to delete the framework: In your case: sudo rm -rf /Users/nick/Library/Developer/Xcode/DerivedData/App-ctjxvxdmomwoobfgvvasfhwvcnhy/Build/Intermediates.noindex/Library-Target.build/Debug-iphonesimulator/Sub-Library-Target.build/Objects-normal/i386/Sub-Library-Class.o

-1

If you are using Objective-C to create frameworks you may end up with those anoying warnings. The solution I've found is to add

-UseModernBuildSystem=NO

at end of every xcodebuild command in your Run Script.

ffabri
  • 657
  • 11
  • 18