Running Flutter iOS app on device throws "Thread 1: signal SIGABRT" error and crashes

Issue

I developed a Flutter app, which when run on iPhone simulators (tested for iPhone X, iPhone 11, iPhone 8) works fine and doesn’t crash. However, when I run the application on my device (iPhone X) the debugger throws an error:

“Thread 1: signal SIGABRT”

The error in “#0 0x0000000100c4b2ac in __abort_with_payload ()” as follows:

dyld`__abort_with_payload:
    0x100c4b2a4 <+0>:  mov    x16, #0x209
    0x100c4b2a8 <+4>:  svc    #0x80
->  0x100c4b2ac <+8>:  b.lo   0x100c4b2c8               ; <+36>   Thread 1: signal SIGABRT
    0x100c4b2b0 <+12>: stp    x29, x30, [sp, #-0x10]!         
    0x100c4b2b4 <+16>: mov    x29, sp
    0x100c4b2b8 <+20>: bl     0x100c497d8               ; cerror_nocancel
    0x100c4b2bc <+24>: mov    sp, x29
    0x100c4b2c0 <+28>: ldp    x29, x30, [sp], #0x10
    0x100c4b2c4 <+32>: ret    
    0x100c4b2c8 <+36>: ret    

Screenshot:

enter image description here

The error in “#6 0x0000000100bfd038 in _dyld_start ()” as follows:

dyld`_dyld_start:
    0x100bfd000 <+0>:   mov    x28, sp
    0x100bfd004 <+4>:   and    sp, x28, #0xfffffffffffffff0
    0x100bfd008 <+8>:   mov    x0, #0x0
    0x100bfd00c <+12>:  mov    x1, #0x0
    0x100bfd010 <+16>:  stp    x1, x0, [sp, #-0x10]!
    0x100bfd014 <+20>:  mov    x29, sp
    0x100bfd018 <+24>:  sub    sp, sp, #0x10             ; =0x10 
    0x100bfd01c <+28>:  ldr    x0, [x28]
    0x100bfd020 <+32>:  ldr    x1, [x28, #0x8]
    0x100bfd024 <+36>:  add    x2, x28, #0x10            ; =0x10 
    0x100bfd028 <+40>:  adrp   x3, -1
    0x100bfd02c <+44>:  add    x3, x3, #0x0              ; =0x0 
    0x100bfd030 <+48>:  mov    x4, sp
    0x100bfd034 <+52>:  bl     0x100bfd07c               ; dyldbootstrap::start(dyld3::MachOLoaded const*, int, char const**, dyld3::MachOLoaded const*, unsigned long*)
->  0x100bfd038 <+56>:  mov    x16, x0            Thread 1: signal SIGABRT
    0x100bfd03c <+60>:  ldr    x1, [sp]
    0x100bfd040 <+64>:  cmp    x1, #0x0                  ; =0x0 
    0x100bfd044 <+68>:  b.ne   0x100bfd050               ; <+80>
    0x100bfd048 <+72>:  add    sp, x28, #0x8             ; =0x8 
    0x100bfd04c <+76>:  braaz  x16
    0x100bfd050 <+80>:  mov    x30, x1
    0x100bfd054 <+84>:  ldr    x0, [x28, #0x8]
    0x100bfd058 <+88>:  add    x1, x28, #0x10            ; =0x10 
    0x100bfd05c <+92>:  add    x2, x1, x0, lsl #3
    0x100bfd060 <+96>:  add    x2, x2, #0x8              ; =0x8 
    0x100bfd064 <+100>: mov    x3, x2
    0x100bfd068 <+104>: ldr    x4, [x3]
    0x100bfd06c <+108>: add    x3, x3, #0x8              ; =0x8 
    0x100bfd070 <+112>: cmp    x4, #0x0                  ; =0x0 
    0x100bfd074 <+116>: b.ne   0x100bfd068               ; <+104>
    0x100bfd078 <+120>: braaz  x16

Screenshot:

enter image description here

The debugger shows the following:

dyld: Library not loaded: @rpath/FMDB.framework/FMDB
  Referenced from: /private/var/containers/Bundle/Application/62D7D2BF-8CDB-4A74-94F5-F6D894C359EC/Runner.app/Runner
  Reason: no suitable image found.  Did find:
    /private/var/containers/Bundle/Application/62D7D2BF-8CDB-4A74-94F5-F6D894C359EC/Runner.app/Frameworks/FMDB.framework/FMDB: code signature invalid for '/private/var/containers/Bundle/Application/62D7D2BF-8CDB-4A74-94F5-F6D894C359EC/Runner.app/Frameworks/FMDB.framework/FMDB'

    /private/var/containers/Bundle/Application/62D7D2BF-8CDB-4A74-94F5-F6D894C359EC/Runner.app/Frameworks/FMDB.framework/FMDB: code signature invalid for '/private/var/containers/Bundle/Application/62D7D2BF-8CDB-4A74-94F5-F6D894C359EC/Runner.app/Frameworks/FMDB.framework/FMDB'

    /private/var/containers/Bundle/Application/62D7D2BF-8CDB-4A74-94F5-F6D894C359EC/Runner.app/Frameworks/FMDB.framework/FMDB: stat() failed with errno=1
    /private/var/containers/Bundle/Application/62D7D2BF-8CDB-4A74-94F5-F6D894C359EC/Runner.app/Frameworks/FMDB.framework/FMDB: code signature invalid for '/private/var/containers/Bundle/Application/62D7D2BF-8CDB-4A74-94F5-F6D894C359EC/Runner.app/Frameworks/FMDB.framework/FMDB'

    /private/var/containers/Bundle/Application/62D7D2BF-8CDB-4A74-94F5-F6D894C359EC/Runner.app/Frameworks/FMDB.framework/FMDB: stat() failed with errno=1
    /private/var/containers/Bundle/Application/62D7D2BF-8CDB-4A74-94F5-F6D894C359EC/Runner.app/Frameworks/FMDB.framework/FMDB: code signature invalid for '/private/var/containers/Bundle/Application/62D7D2BF-8CDB-4A74-94F5-F6D894C359EC/Runner.app/Frameworks/FMDB.framework/FMDB'

    /private/var/containers/Bundle/Application/62D7D2BF-8CDB-4A74-94F5-F6D894C359EC/Runner.app/Frameworks/FMDB.framework/FMDB: stat() failed with errno=1
    /private/var/containers/Bundle/Application/62D7D2BF-8CDB-4A74-94F5-F6D894C359EC/Runner.app/Frameworks/FMDB.framework/FMDB: code signature invalid for '/private/var/containers/Bundle/Application/62D7D2BF-8CDB-4A74-94F5-F6D894C359EC/Runner.app/Frameworks/FMDB.framework/FMDB'

    /private/var/containers/Bundle/Application/62D7D2BF-8CDB-4A74-94F5-F6D894C359EC/Runner.app/Frameworks/FMDB.framework/FMDB: stat() failed with errno=1
(lldb) 

Why the app runs on simulator devices but not on physical device? How can I fix it?

Any help is much appreciated because I am new to Flutter and iOS development.

Solution

The issue was happening because I had iOS 13.3.1 (on my iPhone X device) along with Xcode version 11.3, which has some iOS device integration issue and hence the problem was occurring.

My solution:

Updated my iPhone device to iOS 13.4 and also updated my Xcode to version 11.4. Debugging on device started working properly.

Answered By – Somdip Dey

Answer Checked By – Candace Johnson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.