Ben Scheirman
Ben Scheirman

Reputation: 41001

Error playing videos in MPMoviePlayerController: Symbol not found: ___CFObjCIsCollectable

This is only happening on the iOS 5 Simulator on Lion. If I try it on a device, or the iPhone 4.3 Simulator it works fine.

Basically I'm initializing the moviePlayer with a remote URL, the video buffers and when I would expect it to start playing, it crashes with this error:

2012-01-13 08:07:29.169 pluralsight-app[560:1760f] Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn:  dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
  Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
 in /System/Library/Frameworks/Security.framework/Versions/A/Security
2012-01-13 08:07:29.181 pluralsight-app[560:1760f] Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn:  dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
  Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
 in /System/Library/Frameworks/Security.framework/Versions/A/Security

I've read that this might be a bug in Lion, but hoping to find a workaround, as it is affecting my productivity.

Any ideas?

Upvotes: 3

Views: 1239

Answers (1)

Malcolm Box
Malcolm Box

Reputation: 4036

I had the same problem with AVPlayer and eventually found the problem: I had a breakpoint set for all exceptions, but AVPlayer produces exceptions when working normally. Hence the error message & crash.

To fix: go to the Breakpoint list in XCode (View | Navigators | Debug Navigator) and look for a "All Exceptions" breakpoint - it looks like this: Exception Breakpoint.

Remove that, and try the code again.

The other reason for this crash, reported in some places, is when using ARC and trying to play a sound using a locally-allocated AVPlayer object. Apparently with ARC this can result in the player being cleaned up before the playback happens.

Solution to that is to take a strong reference to the player by assigning to an ivar e.g.

@property (nonatomic, retain) currentPlayer;


- (void) playSound {
    AVAudioPlayer *player = [[AVAudioPlayer alloc] init];
    self.currentPlayer = player; // Need the strong reference otherwise next line can fail
    [player play];
}

Upvotes: 3

Related Questions