Xcode 10 warning: Stale file '/path/to/file' is located outside of the allowed root paths

老子叫甜甜 提交于 2020-05-24 14:44:49

问题


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?


回答1:


I had it on Xcode 11.2

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

Cmd+Shift+R ( build for Running )




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/52478734/xcode-10-warning-stale-file-path-to-file-is-located-outside-of-the-allowed-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!