audio_session icon indicating copy to clipboard operation
audio_session copied to clipboard

Crash on iOS

Open Wackymax opened this issue 3 years ago • 4 comments

Hi,

My app occasionally crashes on iOS and I am not entirely sure how to go about resolving it. I've narrowed it down to this library causing the crash but I am not entirely sure of why that would happen. Here is that trace from XCode.

image

Wackymax avatar Feb 07 '22 11:02 Wackymax

I'm also not an expert with the Xcode debugger, so I sometimes insert NSLog statements into the code for debugging purposes. You can find various other NSLog statements already in the code to see what they look like, or putting a try catch around the code in the routeChange method.

- (void) routeChange:(NSNotification*)notification {
    NSNumber *routeChangeReasonType = (NSNumber*)[notification.userInfo valueForKey:AVAudioSessionRouteChangeReasonKey];
    //NSLog(@"routeChange detected");
    [self invokeMethod:@"onRouteChange" arguments:@[@([routeChangeReasonType integerValue])]];
}

If this callback usually succeeds and sometimes fails, have you narrowed down the circumstances of the crash, suggesting what state things might be in? Maybe it is when the app is being closed, or one of your FlutterEngines is being destroyed? Otherwise if you would like me to take a look, you'll need to create a minimal reproduction project and share it.

ryanheise avatar Feb 07 '22 14:02 ryanheise

Hi, I haven't seen this issue pop up again so I think we can close it

Wackymax avatar Feb 27 '22 13:02 Wackymax

I also encountered this problem, the call stack is exactly the same. audio_session 0.1.10 flutter 3.0.5 iOS 16.1.1

CyrilHu avatar Nov 26 '22 11:11 CyrilHu

I have reopened. @CyrilHu if you are willing to either provide a minimal reproduction project or would be willing to help participating in the debugging, I will be able to investigate it.

ryanheise avatar Nov 26 '22 12:11 ryanheise