Pietro
Pietro

Reputation: 1

Flutter application crashes on iOS devices due to audio_players darwin plugin

I am currently facing an issue regarding my Flutter application. It is currently working fine on Android and all the relative devices but I have a problem with iOS simulators.

The log that I am getting is the following:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Codes: 0x0000000000000001, 0x0000000000000000
VM Region Info: 0 is not in any region.  Bytes before following region: 4355014656
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                      103944000-1043ac000    [ 10.4M] r-x/r-x SM=COW  ...er.app/Runner
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [7972]

Triggered by Thread:  0

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libswiftCore.dylib                  0x7ff81574b899 swift_getObjectType + 25
1   audioplayers_darwin                    0x105356986 static SwiftAudioplayersDarwinPlugin.register(with:) + 86
2   audioplayers_darwin                    0x105356dc7 @objc static SwiftAudioplayersDarwinPlugin.register(with:) + 55
3   audioplayers_darwin                    0x105351444 +[AudioplayersDarwinPlugin registerWithRegistrar:] + 68 (AudioplayersDarwinPlugin.m:13)
4   Runner                                 0x103946dae +[GeneratedPluginRegistrant registerWithRegistry:] + 126 (GeneratedPluginRegistrant.m:54)
5   Runner                                 0x103947089 AppDelegate.application(_:didFinishLaunchingWithOptions:) + 233 (AppDelegate.swift:12)
6   Runner                                 0x103947327 @objc AppDelegate.application(_:didFinishLaunchingWithOptions:) + 183
7   UIKitCore                           0x7ff805cbc5bb -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 297
8   UIKitCore                           0x7ff805cbe320 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 4253
9   UIKitCore                           0x7ff805cc3ea3 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1241
10  UIKitCore                           0x7ff804fe2661 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 122
11  UIKitCore                           0x7ff8056d7e45 _UIScenePerformActionsWithLifecycleActionMask + 87
12  UIKitCore                           0x7ff804fe31bf __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 198
13  UIKitCore                           0x7ff804fe2c20 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 249
14  UIKitCore                           0x7ff804fe3008 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 813
15  UIKitCore                           0x7ff804fe2834 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 341
16  UIKitCore                           0x7ff804fefe25 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 174
17  UIKitCore                           0x7ff805584484 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 865
18  UIKitCore                           0x7ff8056f64c3 _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 261
19  UIKitCore                           0x7ff804fefab4 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 347
20  UIKitCore                           0x7ff804dc04db __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.613 + 877
21  UIKitCore                           0x7ff804dbee90 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 245
22  UIKitCore                           0x7ff804dc0043 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 252
23  UIKitCore                           0x7ff805cc26e3 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 672
24  UIKitCore                           0x7ff8055b9925 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 353
25  FrontBoardServices                  0x7ff807a16db4 -[FBSScene _callOutQueue_didCreateWithTransitionContext:completion:] + 406
26  FrontBoardServices                  0x7ff807a4aa0b __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke.254 + 279
27  FrontBoardServices                  0x7ff807a26a78 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 213
28  FrontBoardServices                  0x7ff807a4a705 __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke + 328
29  libdispatch.dylib                   0x7ff8001796d8 _dispatch_client_callout + 8
30  libdispatch.dylib                   0x7ff80017d1e2 _dispatch_block_invoke_direct + 508
31  FrontBoardServices                  0x7ff807a7635f __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
32  FrontBoardServices                  0x7ff807a76239 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 188
33  FrontBoardServices                  0x7ff807a76387 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 19
34  CoreFoundation                      0x7ff800429fb3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
35  CoreFoundation                      0x7ff800429ef5 __CFRunLoopDoSource0 + 157
36  CoreFoundation                      0x7ff8004296f2 __CFRunLoopDoSources0 + 215
37  CoreFoundation                      0x7ff800423e27 __CFRunLoopRun + 919
38  CoreFoundation                      0x7ff8004236ad CFRunLoopRunSpecific + 557
39  GraphicsServices                    0x7ff8103da08f GSEventRunModal + 137
40  UIKitCore                           0x7ff805cc0ad1 -[UIApplication _run] + 972
41  UIKitCore                           0x7ff805cc5551 UIApplicationMain + 123
42  Runner                                 0x10394748f main + 63 (AppDelegate.swift:6)
43  dyld_sim                               0x104e173e0 start_sim + 10
44  dyld                                   0x10d4d2386 start + 1942

Thread 1:
0   libsystem_pthread.dylib                0x1054aeb88 start_wqthread + 0

Thread 2:
0   libsystem_pthread.dylib                0x1054aeb88 start_wqthread + 0

Thread 3:
0   libsystem_pthread.dylib                0x1054aeb88 start_wqthread + 0

Thread 4:: com.apple.uikit.eventfetch-thread
0   libsystem_kernel.dylib                 0x105442a2e mach_msg2_trap + 10
1   libsystem_kernel.dylib                 0x105450e3a mach_msg2_internal + 84
2   libsystem_kernel.dylib                 0x105449b62 mach_msg_overwrite + 653
3   libsystem_kernel.dylib                 0x105442d1f mach_msg + 19
4   CoreFoundation                      0x7ff800429863 __CFRunLoopServiceMachPort + 143
5   CoreFoundation                      0x7ff800423feb __CFRunLoopRun + 1371
6   CoreFoundation                      0x7ff8004236ad CFRunLoopRunSpecific + 557
7   Foundation                          0x7ff800e89cda -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 213
8   Foundation                          0x7ff800e89f58 -[NSRunLoop(NSRunLoop) runUntilDate:] + 72
9   UIKitCore                           0x7ff805d9e85a -[UIEventFetcher threadMain] + 518
10  Foundation                          0x7ff800eb4515 __NSThread__start__ + 1024
11  libsystem_pthread.dylib                0x1054b3202 _pthread_start + 99
12  libsystem_pthread.dylib                0x1054aebab thread_start + 15

Thread 5:
0   libsystem_pthread.dylib                0x1054aeb88 start_wqthread + 0

Thread 6::  Dispatch queue: com.apple.UIKit.KeyboardManagement
0   libsystem_kernel.dylib                 0x1054441e2 __ulock_wait + 10
1   libdispatch.dylib                   0x7ff800179e96 _dlock_wait + 46
2   libdispatch.dylib                   0x7ff800179ced _dispatch_thread_event_wait_slow + 40
3   libdispatch.dylib                   0x7ff8001894c7 __DISPATCH_WAIT_FOR_QUEUE__ + 356
4   libdispatch.dylib                   0x7ff800189025 _dispatch_sync_f_slow + 196
5   UIKitCore                           0x7ff805aa7170 __37-[_UIRemoteKeyboards startConnection]_block_invoke_2 + 108
6   CoreFoundation                      0x7ff8004d415c __invoking___ + 140
7   CoreFoundation                      0x7ff8004d1483 -[NSInvocation invoke] + 302
8   Foundation                          0x7ff800f858e2 __NSXPCCONNECTION_IS_CALLING_OUT_TO_REPLY_BLOCK__ + 17
9   Foundation                          0x7ff800f854a2 -[NSXPCConnection _decodeAndInvokeReplyBlockWithEvent:sequence:replyInfo:] + 642
10  Foundation                          0x7ff800f8a017 __88-[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:]_block_invoke_3 + 205
11  libxpc.dylib                        0x7ff8000c8ad0 _xpc_connection_reply_callout + 36
12  libxpc.dylib                        0x7ff8000bd2f0 _xpc_connection_call_reply_async + 69
13  libdispatch.dylib                   0x7ff80017973e _dispatch_client_callout3 + 8
14  libdispatch.dylib                   0x7ff800197c37 _dispatch_mach_msg_async_reply_invoke + 609
15  libdispatch.dylib                   0x7ff800180f59 _dispatch_lane_serial_drain + 424
16  libdispatch.dylib                   0x7ff800181e17 _dispatch_lane_invoke + 406
17  libdispatch.dylib                   0x7ff80018d9a8 _dispatch_root_queue_drain_deferred_wlh + 276
18  libdispatch.dylib                   0x7ff80018cf72 _dispatch_workloop_worker_thread + 552
19  libsystem_pthread.dylib                0x1054afc47 _pthread_wqthread + 327
20  libsystem_pthread.dylib                0x1054aeb97 start_wqthread + 15

Thread 7:
0   libsystem_pthread.dylib                0x1054aeb88 start_wqthread + 0

Thread 8:
0   libsystem_pthread.dylib                0x1054aeb88 start_wqthread + 0


Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x000000010536d258  rbx: 0x0000000000000000  rcx: 0x000000010d578240  rdx: 0x0000000000000000
  rdi: 0x0000000000000000  rsi: 0x000000010530f361  rbp: 0x00007ff7bc5b7a50  rsp: 0x00007ff7bc5b7a40
   r8: 0xffffffffffffffff   r9: 0x0000600000c01170  r10: 0x000000010536d75a  r11: 0x0000000105356d90
  r12: 0x0000000000000001  r13: 0x000000010536d258  r14: 0x0000000005e06701  r15: 0x0000000105e067f0
  rip: 0x00007ff81574b899  rfl: 0x0000000000010246  cr2: 0x0000000000000000
  
Logical CPU:     0
Error Code:      0x00000004 (no mapping for user data read)
Trap Number:     14


Binary Images:
       0x10d4cc000 -        0x10d56bfff dyld (*) <01ae3ae3-f6ca-34d1-a2f8-462ede5fa818> /usr/lib/dyld
       0x104f40000 -        0x104f4cfff libobjc-trampolines.dylib (*) <a6401717-341d-36ad-bc04-530cab6a900e> /Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc-trampolines.dylib
       0x10534f000 -        0x10536afff org.cocoapods.audioplayers-darwin (0.0.1) <4f3da850-ef83-3d18-b969-232b3df41875> /Users/USER/Library/Developer/CoreSimulator/Devices/3FE71ECE-30DC-4683-8925-B59602F7B4B7/data/Containers/Bundle/Application/55EF5C37-B7B6-4BE9-A8A3-336AB1B73F92/Runner.app/Frameworks/audioplayers_darwin.framework/audioplayers_darwin
       0x105301000 -        0x105302fff org.cocoapods.flutter-native-splash (0.0.1) <4f4b17c9-251a-35ad-a57e-5175c34a939d> /Users/USER/Library/Developer/CoreSimulator/Devices/3FE71ECE-30DC-4683-8925-B59602F7B4B7/data/Containers/Bundle/Application/55EF5C37-B7B6-4BE9-A8A3-336AB1B73F92/Runner.app/Frameworks/flutter_native_splash.framework/flutter_native_splash
       0x10530d000 -        0x10530ffff org.cocoapods.maps-launcher (0.0.1) <df8ef94d-884e-3e31-98b8-f40da7fccdb2> /Users/USER/Library/Developer/CoreSimulator/Devices/3FE71ECE-30DC-4683-8925-B59602F7B4B7/data/Containers/Bundle/Application/55EF5C37-B7B6-4BE9-A8A3-336AB1B73F92/Runner.app/Frameworks/maps_launcher.framework/maps_launcher
       0x10539b000 -        0x1053a2fff org.cocoapods.path-provider-foundation (0.0.1) <aab56bcd-d799-3974-95d0-b2534c30654c> /Users/USER/Library/Developer/CoreSimulator/Devices/3FE71ECE-30DC-4683-8925-B59602F7B4B7/data/Containers/Bundle/Application/55EF5C37-B7B6-4BE9-A8A3-336AB1B73F92/Runner.app/Frameworks/path_provider_foundation.framework/path_provider_foundation
       0x1053b5000 -        0x1053c3fff org.cocoapods.url-launcher-ios (0.0.1) <ddc7fa68-47ea-3f1b-8674-4c4150337e98> /Users/USER/Library/Developer/CoreSimulator/Devices/3FE71ECE-30DC-4683-8925-B59602F7B4B7/data/Containers/Bundle/Application/55EF5C37-B7B6-4BE9-A8A3-336AB1B73F92/Runner.app/Frameworks/url_launcher_ios.framework/url_launcher_ios
       0x108df1000 -        0x10b06afff io.flutter.flutter (1.0) <4c4c446e-5555-3144-a132-2e5e0328417b> /Users/USER/Library/Developer/CoreSimulator/Devices/3FE71ECE-30DC-4683-8925-B59602F7B4B7/data/Containers/Bundle/Application/55EF5C37-B7B6-4BE9-A8A3-336AB1B73F92/Runner.app/Frameworks/Flutter.framework/Flutter
       0x10531a000 -        0x105325fff libsystem_platform.dylib (*) <20d7a65a-313d-3aa7-b0d4-a39261e1b00a> /usr/lib/system/libsystem_platform.dylib
       0x105441000 -        0x10547cfff libsystem_kernel.dylib (*) <3e22fb41-20e3-3568-a00b-d8e901e333bf> /usr/lib/system/libsystem_kernel.dylib
       0x1054ad000 -        0x1054b8fff libsystem_pthread.dylib (*) <0f6c8ecc-a9bd-39c6-9f41-a8b9159201eb> /usr/lib/system/libsystem_pthread.dylib
       0x103944000 -        0x1043abfff com.AmiciDiDizzasco.invasioneDegliAsini (1.0.0) <c0859a88-90c0-327d-8e32-60b91fe9b284> /Users/USER/Library/Developer/CoreSimulator/Devices/3FE71ECE-30DC-4683-8925-B59602F7B4B7/data/Containers/Bundle/Application/55EF5C37-B7B6-4BE9-A8A3-336AB1B73F92/Runner.app/Runner
       0x104e16000 -        0x104e70fff dyld_sim (*) <0a2ea2cc-8e7f-3953-a752-65d9ba23780f> /Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/dyld_sim
    0x7ff8153e6000 -     0x7ff815892ff7 libswiftCore.dylib (*) <fc80f64a-706e-3499-a394-f8617cc4f056> /Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/libswiftCore.dylib
    0x7ff804c9a000 -     0x7ff806ac7ff9 com.apple.UIKitCore (1.0) <1d84d490-3f73-3a20-ab06-93726e3e4f47> /Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
    0x7ff807a08000 -     0x7ff807acfffc com.apple.FrontBoardServices (867.314) <8225141a-18ea-337a-9a1b-5ef24589c734> /Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices
    0x7ff800176000 -     0x7ff8001c1ff9 libdispatch.dylib (*) <737fcc80-aed1-338a-9314-1c46fe2e790f> /Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdispatch.dylib
    0x7ff80039c000 -     0x7ff80072aff4 com.apple.CoreFoundation (6.9) <02d074a1-987d-3381-a834-450a0546dec1> /Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
    0x7ff8103d7000 -     0x7ff8103deffe com.apple.GraphicsServices (1.0) <fff86afc-201a-3f20-a34a-0ff583b33181> /Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
    0x7ff8007a5000 -     0x7ff801306ff9 com.apple.Foundation (6.9) <5491c554-518f-3700-8c29-7a99d3b7342a> /Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Foundation
    0x7ff8000b0000 -     0x7ff8000ecffd libxpc.dylib (*) <0cbe521f-0d3d-3b0d-8151-a5bfa37cfd5f> /Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libxpc.dylib

EOF

It seems like the problem is related to the audioplayers_darwin plugin not being able to startup and crashing the application on launch, without even opening it.

I am not sure if has something to do with Xcode and Flutter versioning or with some plugins' dependencies but I'll leave here some screenshots of the things that I checked.

pubspec.yaml Pods

I tried many and different solutions found on online:

Upvotes: 0

Views: 136

Answers (1)

Olivier Griffet
Olivier Griffet

Reputation: 1

After many days, I found the problem, you need to build in "release" mode instead of "debug" mode. It's not related to the audio_players darwin plugin. You will have the same problems for others publings.

Upvotes: 0

Related Questions