Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-18844

iOS: Swift is not supported for Extensions

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 4.0.0
    • Component/s: iOS
    • Environment:

      iOS 8.3, Xcode 6.3, SDK 4 Beta 3

      Description

      I have built a WatchKit extension in Swift. All works beautifully in the simulator when running directly from xcode.

      I have linked to the extension from my Titanium project, and everything builds without error, yet when running the "xcrun simctl launch booted" command to launch the watch, I get an infinite loading animation.

      Upon digging through the logs I got many errors such as “Unable to start plugin” and "activePlugInForIdentifier: returned nil for application". I also stumbled upon a crash log which seems to point the finger more accurately:

      Process: JAS Watch WatchKit Extension [27101]

      Dyld Error Message:
      Library not loaded: @rpath/libswiftCore.dylib
      Referenced from: /Users/USER/Library/Developer/CoreSimulator/Devices/4CEFE848-E6EB-41D2-8968-754C449E19A8/data/Containers/Bundle/Application/5B42A276-DD25-4288-82A4-C1C2CFBE527E/Just a Score.app/PlugIns/JAS Watch WatchKit Extension.appex/JAS Watch WatchKit Extension
      Reason: image not found

      It seems that “libswiftCore.dylib” is not getting included, a quick Google search will lead you to discover that there is a flag in a projects build settings called “Embedded Content Contains Swift Code”. This flag needs to be checked in order to run an objective-c project with embedded Swift content.

      I’m sure this would be the case with any Swift extension and Titanium for reproduction. Hopefully this flag solves the issue.
      Urgency in finding a solution to this would be greatly appreciated.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                penrique Pedro Enrique (Inactive)
                Reporter:
                jdrucey Jamie Druce
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-19876
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code