[BUG] Crash when "hot restart" (with crash report & cause of it)
See original GitHub issueWhen running the sample app and click “hot restart”, the app crashes (iOS emulator and iOS device).
The crash report says
Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information: Assertion failed: (flautoPlayerSlots[slotNo] == [NSNull null]), function -[FlautoPlayerManager handleMethodCall:result:], file /Users/tom/RefCode/flutter_sound-4/ios/Classes/FlutterSoundPlayer.m, line 104.
CoreSimulator 704.12.2 - Device: iPhone SE (2nd generation) (9FF71C9F-9919-4E46-BF44-4292C0AB5C10) - Runtime: iOS 13.5 (17F61) - DeviceType: iPhone SE (2nd generation)
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x00007fff51b617fa __pthread_kill + 10 1 libsystem_pthread.dylib 0x00007fff51c0cbc1 pthread_kill + 432 2 libsystem_c.dylib 0x00007fff51af0b7c abort + 120 3 libsystem_c.dylib 0x00007fff51aefe36 __assert_rtn + 314 4 com.dooboolab.FlutterSoundDemo 0x0000000104d02134 -[FlautoPlayerManager handleMethodCall:result:] + 788 5 io.flutter.flutter 0x0000000106a889df __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 104 6 io.flutter.flutter 0x0000000106a17622 flutter::PlatformMessageRouter::HandlePlatformMessage(fml::RefPtrflutter::PlatformMessage) const + 166 7 io.flutter.flutter 0x0000000106a1b77a flutter::PlatformViewIOS::HandlePlatformMessage(fml::RefPtrflutter::PlatformMessage) + 38 8 io.flutter.flutter 0x0000000106a826bb std::__1::__function::__func<flutter::Shell::OnEngineHandlePlatformMessage(fml::RefPtrflutter::PlatformMessage):😒_32, std::__1::allocator<flutter::Shell::OnEngineHandlePlatformMessage(fml::RefPtrflutter::PlatformMessage):😒_32>, void ()>::operator()() + 57 9 io.flutter.flutter 0x0000000106a2c267 fml::MessageLoopImpl::FlushTasks(fml::FlushType) + 117 10 io.flutter.flutter 0x0000000106a311b4 fml::MessageLoopDarwin::OnTimerFire(__CFRunLoopTimer*, fml::MessageLoopDarwin*) + 26 11 com.apple.CoreFoundation 0x00007fff23da14b4 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 20 12 com.apple.CoreFoundation 0x00007fff23da114e __CFRunLoopDoTimer + 1038 13 com.apple.CoreFoundation 0x00007fff23da07aa __CFRunLoopDoTimers + 282 14 com.apple.CoreFoundation 0x00007fff23d9b3fe __CFRunLoopRun + 1950 15 com.apple.CoreFoundation 0x00007fff23d9a944 CFRunLoopRunSpecific + 404 16 com.apple.GeoServices 0x00007fff38ba6c1a GSEventRunModal + 139 17 com.apple.UIKitCore 0x00007fff48c8b9ec UIApplicationMain + 1605 18 com.dooboolab.FlutterSoundDemo 0x0000000104cfd4db main + 75 (AppDelegate.swift:5) 19 libdyld.dylib 0x00007fff51a231fd start + 1
so the most important line is :
Application Specific Information:
Assertion failed: (flautoPlayerSlots[slotNo] == [NSNull null]), function -[FlautoPlayerManager handleMethodCall:result:], file /Users/tom/RefCode/flutter_sound-4/ios/Classes/FlutterSoundPlayer.m, line 104.
maybe caused by the resource not get freed when hot restarting.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8
Top GitHub Comments
I have a similar problem. If I open an AudioSession in my app at start (for example to start recordings) and then hot restart the app, the app crashes when I try to open an AudioSession again. Unfortunately I have not found a way to kill the old AudioSession. Because after the hot restart flutter_sound has no open audio session anymore. But on native iOS the AudioSession is still running.
Fixed in Flutter Sound release 7.6.3