0

I have a little Swift project that talks to iTunes on macOS. The project built perfectly under macOS 10.13 with XCode 9, but ever since updating to 10.14 and XCode 10 compiling fails with the following message:

<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/iTunesLibrary.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/iTunesLibrary.framework/Headers/iTunesLibrary.h:12:9: error: 'iTunesLibrary/ITLibDefines.h' file not found
#import <iTunesLibrary/ITLibDefines.h>
        ^
/MY_PROJECT_PATH/ITunesLibrary.swift:10:8: error: could not build Objective-C module 'iTunesLibrary'
import iTunesLibrary
       ^

I have checked in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/iTunesLibrary.framework/Headers, the files iTunesLibrary.h and ITLibDefines.hexist. iTunesLibrary.h content is:

/*!
    @header     iTunesLibrary.h

    @copyright  (c) 2012-2014 Apple Inc. All rights reserved.
*/

#ifndef ITUNESLIBRARY_H
#define ITUNESLIBRARY_H

#import <Foundation/Foundation.h>

#import <iTunesLibrary/ITLibDefines.h>
#import <iTunesLibrary/ITLibAlbum.h>
#import <iTunesLibrary/ITLibArtist.h>
#import <iTunesLibrary/ITLibArtwork.h>
#import <iTunesLibrary/ITLibMediaEntity.h>
#import <iTunesLibrary/ITLibMediaItem.h>
#import <iTunesLibrary/ITLibMediaItemVideoInfo.h>
#import <iTunesLibrary/ITLibPlaylist.h>
#import <iTunesLibrary/ITLibrary.h>

#endif  /* ITUNESLIBRARY_H */

Since iTunesLibrary.h is found by the compiler, I am puzzled, why <iTunesLibrary/ITLibDefines.h> cannot be found.

Any ideas? Some search path?

Thanks.

Hendrik
  • 5,085
  • 24
  • 56

2 Answers2

1

Turns out the framework search path (under Project->Target->Build Settings) was indeed the culprit. Removing my custom overrides solved the issue. Interestingly, if I remember correctly, I had added them, because Xcode wasn't able to find my frameworks...

See also https://forums.developer.apple.com/message/328635#328779

Hendrik
  • 5,085
  • 24
  • 56
0

Set "Always Search User Paths" to NO and problem will be solved

KamyFC
  • 858
  • 9
  • 17