3

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?

Ben Scheirman
  • 40,531
  • 21
  • 102
  • 137
  • Does it really crash or do you just see these errors in the console and it keeps playing back the sound just fine (8 times the very same error message, then playback starts fine)? In any case, from my experience Xcode 4.2.1 (just as well as the new betas) show similar error messages within the iOS 5.x simulators (not on lower versions) but play just fine (no crash) on Lion. See http://stackoverflow.com/questions/7961840/what-does-this-gdb-output-mean/8317546#8317546 – Till Jan 14 '12 at 00:33
  • Well, then I would advise you to reinstall Xcode (make sure you do a clean sweep; `sudo /Developer/Library/uninstall-devtools --mode=all`) as this seems to be a broken installation - to me, it appears to be a mixup of several versions of the simulator. – Till Jan 15 '12 at 22:47
  • How did you finally solve the issue? – Till Apr 18 '12 at 11:43

1 Answers1

3

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];
}
Malcolm Box
  • 3,968
  • 1
  • 26
  • 44
  • *think* this is a duplicate of http://stackoverflow.com/questions/7407323/mpmovieplayercontroller-not-working-in-ios-5-xcode-with-storyboard-but-works – David Lam Sep 22 '12 at 06:59