eoinzy
eoinzy

Reputation: 2242

Undefined symbols for architecture x86_64: MPMusicPlayerController

I am using XCode 8.3 and Swift 3.

I am getting the following error related to the AudioToolboxFramework and x86_64 architecture:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_MPMusicPlayerController", referenced from:
      objc-class-ref in libdtdev.a(AudioStream.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

My project targets iOS 10.3 and in build settings the Architectures are listed as: Standard Architecture (armv7, arm64) - $(ARCH_STANDARD)

The valid architectures are: arm64 armv7 armv7s

For the settings Build Active Architectures Only, I have it set to YES for DEBUG and NO for RELEASE.

Can anyone tell me why I'm still getting an error relating to x86_64? Is it possibly from another Framework?

My Podfile contains:

pod 'Alamofire', '~> 4.4'
pod 'SwiftyJSON'
pod 'Fabric'
pod 'Crashlytics'
pod 'ReachabilitySwift'

Actually, I've just changed the Build Active Architectures Only for DEBUG to NO and got a lot of errors saying No such module 'ReachabilitySwift' so maybe its related to that library? I also get the same error if I remove the AudioToolbox.framework from General -> Linked Frameworks and Libraries.

Also, I ran: lipo -info ./MyProject/Library/libdtdev.a

and got this: Architectures in the fat file: ./MyProject/Library/libdtdev.a are: armv7 i386 x86_64 arm64

So there is definitely something defining the x86_64 arch.

Upvotes: 2

Views: 2102

Answers (1)

eoinzy
eoinzy

Reputation: 2242

I got the solution from this link: MPMusicPlayerController and setNowPlayingItem

The solution was to add the MediaPlayer.framework to the Linked Frameworks and Libraries.

Upvotes: 2

Related Questions