Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

iOS runtime crash with Swift framework

Discussion in 'iOS and tvOS' started by BinaryShrub, May 14, 2017.

  1. BinaryShrub

    BinaryShrub

    Joined:
    May 14, 2017
    Posts:
    1
    I am trying to integrate a new framework to the iOS project that Unity generates, but the moment I add a Swift file to the framework I get the runtime exception below:

    dyld`__abort_with_payload:
    0x10311dcb4 <+0>: movz x16, #0x209
    0x10311dcb8 <+4>: svc #0x80
    -> 0x10311dcbc <+8>: b.lo 0x10311dcd4 ; <+32>
    0x10311dcc0 <+12>: stp x29, x30, [sp, #-16]!
    0x10311dcc4 <+16>: mov x29, sp
    0x10311dcc8 <+20>: bl 0x10311d500 ; cerror_nocancel
    0x10311dccc <+24>: mov sp, x29
    0x10311dcd0 <+28>: ldp x29, x30, [sp], #16
    0x10311dcd4 <+32>: ret


    Screen Shot 2017-05-13 at 4.08.13 PM.png

    Does the generated Unity project support Swift?

    Things I have tried:
    • Build new iOS project from Unity, WORKS
    • Create new Framework (blank) and use it in the project, WORKS
    • Add unused Obj-C file to the Framework, WORKS
    • Add unused Swift file to the Framework, RUNTIME ERROR
     
  2. killergerbah_

    killergerbah_

    Joined:
    Oct 29, 2014
    Posts:
    5
    Hi,
    You might consider making sure the generated XCode project includes the basic Swift libraries.
    The way I have done this in my project is using the XCode project manipulator API and the following code:

    proj.SetBuildProperty(targetGuid, "SWIFT_VERSION", "3.0");
    proj.SetBuildProperty(targetGuid, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "YES");
     
    andymads likes this.