Lots of warnings when building with Xcode 7 with 3rd party libraries

I am getting a large number of warnings when compiling my project in Xcode 7 GM (bitcode is NOT enabled) in regards to third party static libraries. Xcode is complaining about "No such file or directory" or "Could not resolve external type". All of this used to work perfectly, the only changes made were an updated version of the library and the use of Xcode 7 GM.


This seems to be happening with many other people as well, as it can be seen here: http://sensiblecocoa.com/community/topic/2344-warnings-with-stv-500-and-xcode-7-beta-5/


Here is a sample list of warnings:


(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/Foundation-3DFYNEBRQSXST.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/Foundation-3DFYNEBRQSXST.pcm: No object file for requested architecture

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/ObjectiveC-1RQA2RIXJIE19.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/ObjectiveC-1RQA2RIXJIE19.pcm: No object file for requested architecture

(null): warning: Could not resolve external type c:objc(cs)NSString

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/Social-N94D31PLFESQ.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/Social-N94D31PLFESQ.pcm: No object file for requested architecture

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/Accounts-V2GNZG08D26T.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/Accounts-V2GNZG08D26T.pcm: No object file for requested architecture

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/CoreLocation-2RB9TGORWT0YQ.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/CoreLocation-2RB9TGORWT0YQ.pcm: No object file for requested architecture

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/UIKit-1V5UHAPTOD24G.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/UIKit-1V5UHAPTOD24G.pcm: No object file for requested architecture

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/CoreGraphics-N94D31PLFESQ.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/CoreGraphics-N94D31PLFESQ.pcm: No object file for requested architecture

(null): warning: Could not resolve external type c:objc(cs)NSObject

(null): warning: Could not resolve external type c:objc(cs)ACAccountStore

(null): warning: Could not resolve external type c:objc(cs)NSMutableArray

(null): warning: Could not resolve external type c:objc(cs)NSError

(null): warning: Could not resolve external type c:objc(cs)NSURL

(null): warning: Could not resolve external type c:objc(cs)NSURLRequest

(null): warning: Could not resolve external type c:objc(cs)NSURLResponse

(null): warning: Could not resolve external type c:objc(cs)NSData

(null): warning: Could not resolve external type c:objc(cs)NSDictionary

(null): warning: Could not resolve external type c:objc(cs)ACAccountType

(null): warning: Could not resolve external type c:objc(cs)NSMutableDictionary

(null): warning: Could not resolve external type c:objc(cs)ACAccount

(null): warning: Could not resolve external type c:objc(cs)NSNotification

(null): warning: Could not resolve external type c:objc(cs)NSPredicate

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/SystemConfiguration-354UAJE49HRJF.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/SystemConfiguration-354UAJE49HRJF.pcm: No object file for requested architecture

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/Darwin-38I6DLZ5IH61J.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/Darwin-38I6DLZ5IH61J.pcm: No object file for requested architecture

(null): warning: Could not resolve external type c:objc(cs)NSNumber

(null): warning: Could not resolve external type c:objc(cs)NSArray

(null): warning: Could not resolve external type c:objc(cs)NSDate

(null): warning: Could not resolve external type c:objc(cs)UIApplication

(null): warning: Could not resolve external type c:objc(cs)UIDevice

(null): warning: Could not resolve external type c:objc(cs)NSLocale

(null): warning: Could not resolve external type c:objc(cs)NSBundle

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/MachO-1BMJAO5Q3NM3O.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/MachO-1BMJAO5Q3NM3O.pcm: No object file for requested architecture

Accepted Answer

The solution that finally worked for me was a combination of the partial solutions pointed out by BrettThePark and Adrian Prantl (big thanks).


  • Precompile Prefix (GCC_PRECOMPILE_PREFIX_HEADER) = NO
  • Debug Information Format (DEBUG_INFORMATION_FORMAT) = DWARF with dSYM
  • Enabled Modules (C and Objective-C) (CLANG_ENABLE_MODULES) = NO


After that the warnings no longer appear and all else behaves as expected.

Answers

I'm having this problem too

I'm seeing the same issue with a 3rd party framework - lots of "Could not resolve external type" for many of the NSFoundation objects.

It turns out that this is related to the way precompiled headers are built in those third party libraries. The issue turns out to be a known one that started appearing in Xcode 7 Beta 5 and is still appearing in Xcode 7 GM Seed.


Check the following article for the list of known issues in Xcode 7 Beta:

http://fortheloveoftech.com/2015/06/08/apple-releases-xcode-7-beta/

If you have control over those 3rd party libraries (i.e. if you have the source code of their projects) then turn off the setting "Precompile Prefix Header" in the main targets of those libraries.

Thanks, I tried your suggestion, but it didn't work. The issue is still there.


If I build exactly the same code with Xcode 6 everything works perfectly fine, only when built with Xcode 7 the problem appears.

Did you try cleaning up your build directories (Command+Alt+Shift+K) after doing the change suggested above and then rebuilding your project? Otherwise you can set the "Debug Information Format" setting in your main project to "DWARF" for "Debug" and "Release" instead of "DWARF with dSYM File" and see if that resolves the problem.

Yes, I have done all that. However, the option to set "Debug Information Format" to "DWARF", rather than "DWARF with dSYM" is not a viable alternative, since it prevents the capture of crash reports by Crashlytics, HockeyApp, etc.

I had this problem too. Here's how I fixed it.


1) Go to Build Settings -> Build Options -> Debug Information Format


2) Change the Debug setting from "DWARF with dSYM File" to "DWARF"


3) Leave the Release setting at "DWARF with dSYM File"


The problem appears to be that Xcode was trying to create dSYM files for Debug builds. You don't need dSYM files for Debug builds -- it's release builds where you need them.


I hope this helps.


Sincerely,


Michael Patrick Ellard

Hmmm... Yesterday, this solution worked for me and I was able to do debugging builds and distribution archives without a problem.


Today, I'm back to having the same problem when doing archives.

Has anyone found a solution to this? I'm having this same problem with the static libraries and frameworks that I create, and the only solution that seems to work is having the apps that integrates the library set their "Debug Information Format" to "DWARF" vs "DWARF with dSYM File".


DWARF seems to be the default setting for new projects created in Xcode 7, but existing projects that are migrating to Xcode 7 probably still have DWARF with dSYM File as the setting.


It would be nice if someone from Apple could chime in on what the ideal solution is. 😐

I finally Googled a solution to this:


https://github.com/zendesk/zendesk_sdk_ios/issues/79


To quote " A build option, CLANG_ENABLE_MODULES which is set to YES by default, caused these errors when built with Xcode 7"


So if you set CLANG_ENABLE_MODULES to NO in the build settings of the 3rd party library then all those warnings should disappear.


It looks to be working for Sensible Table View which was linked to in the first post: http://sensiblecocoa.com/community/topic/2344-warnings-with-stv-500-and-xcode-7-beta-5/#entry12829


Thanks to the zendesk_sdk_ios develpers for finding this!

Hi guys !


I did this:


rename project to old

create a new project with xcode 7 and same name

select all on mainstoryboard -> copy and paste to new project

create all files again with same name xyzUIViewController using file-> new ...

select each file - copy all code lines -> paste to new files

Run again and no warnings!

I'm just wondering if it's because the new project in Xcode 7 has the "Debug Information Format" build setting set to DWARF, where the old project (pre Xcode 7 ) is DWARF with dSYM File

I created a new project in Xcode 6 and a new project in Xcode 7 and compared the .project files. It looks like the "Debug Information Format" default has been changed from Xcode 6 to Xcode 7, but any project that originated from Xcode 6 would still have this turned on.


Xcode 6:

DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";

Xcode 7:

DEBUG_INFORMATION_FORMAT = "dwarf";


This is found in "Build Settings" -> "Build Options" -> "Debug Information Format" as mentioned above. Just wanted to give some more insight into this.

Hi all.

My organization is also seeing this issue with all of our internal frameworks we create and distirbute. I went ahead and opened up a bug report (22855810) for this.


For us we find the issue only occurs when we build the framework on one machine and then try to import it into another app on another developer's machine. The dSYM file warnings seem to mention diretories that have our user names or machine names hard coded into them.


Sadly for us none of the project setting changes above reoslve the issue other than changing "Debug Information Format" to "DWARF". Our concern though is that means we can't symbolicate crash reports since it seems we just bypass the dSYM file generation step?


If anyone has any other information or ideas for a workaround or some other fix please let us know


Thanks!