Static libraries using modules cause warnings ("Could not resolve external type", "*.pcm: No such file or directory")

Number:rdar://22978324 Date Originated:05-Oct-2015
Status:Duplicate of 23893301 (Open) Resolved:
Product:Developer Tools (Xcode) Product Version:7.0.1
Classification:Other Bug Reproducible:Always
Static libraries built using modules (e.g. "@import StoreKit"), even with CLANG_ENABLE_MODULE_DEBUGGING set to false, cause warnings when used on another developer's computer. This issue is described on this apple forum thread:

These are the types of warnings caused:

while processing /Users/monroe/dev/ios-example-app/libStaticLibraryTest.a(StaticLibraryTest.o):
warning: /Users/Max/Library/Developer/Xcode/DerivedData/ModuleCache/1FI596T6DYYKL/AdSupport-N94D31PLFESQ.pcm: No such file or directory
while processing /Users/monroe/dev/ios-example-app/libStaticLibraryTest.a(StaticLibraryTest.o):
warning: /Users/Max/Library/Developer/Xcode/DerivedData/ModuleCache/1FI596T6DYYKL/AdSupport-N94D31PLFESQ.pcm: No object file for requested architecture

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

Steps to Reproduce:
Option a): Build a static library from the attached "StaticLibraryTest" project and skip to step 4.

Option b): Follow the steps below to reproduce from scratch:

1. Create a new Xcode project using the Cocoa Touch Static Library framework
2. Use a module in the project (I @imported StoreKit and used it in a method)
3. Follow the instructions here on creating a universal binary (one with i386 and ARM code) This consists of:
    3.1. Set "Build Active Architecture Only" to NO
    3.2. Set the public headers directory to "Headers"
    3.3. Add new Run Script Build Phase. Paste in this script:

4. Set current scheme to "Release" and build the project. The built library is attached as ""
5. From a different computer (I could not reproduce on my own computer), create a new project and copy the universal library and header files in from the Derived Data folder.
6. Import that library and reference it

Expected Results:
The new project builds without warnings

Actual Results:
The project has a huge number of warnings related to .pcm files, or not being able to "resolve external type"s.

Xcode 7.0.1

Many developers are reporting this problem here:


'' and '' were successfully uploaded.


Followup message:

If you then disable modules, and replace any @imports with #import <framework>, then the warnings disappear. Attached is the static library built without modules.

'' was successfully uploaded.




Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!