I was able to successfully archive Xcode 4, but suddenly (??) I canβt. Build failed .pch file not valid. The error is inserted below (obtained from -Winvalid-pch using -Winvalid-pch , but what seems to come from the build log is that the precompiled header is not actually going to be precompiled - this is an iOS application and goes right from the step CopyPNG to compile .m.
Can I accidentally flip something? Nothing seems strange in my diff .pbxproj file.
cc1obj: warning: /Users/myname/Library/Developer/Xcode/DerivedData/Foo-afikuaovoaeqhreaaaakpafseuuv/Build/PrecompiledHeaders/Foo_Prefix-guqixmujoiaaaacwjctfkrztxmbz/Foo_Prefix.pch.gch: created by a different GCC executable cc1obj: error: /Users/myname/Library/Developer/Xcode/DerivedData/Foo-afikuaovoaeqhreaaaakpafseuuv/Build/PrecompiledHeaders/Foo_Prefix-guqixmujoiaaaacwjctfkrztxmbz/Foo_Prefix.pch: No such file or directory cc1obj: error: one or more PCH files were found, but they were invalid
"Precompile Prefix Header" Build Setting - Yes for all configurations. Product-> Pure does not help. Removing a cached pch file from derived data does not fix it. In fact, it seems that the entire "precompilation" step is missing.
Another factoid: Enabling the option "Increase sharing of precompiled headers" allows it to succeed. But I can find almost no reference to what this flag really does, and I have never used it before. And it is perhaps prudent that the precompilation step still does not appear when this happens.
source share