cordova-plugin-add-swift-support icon indicating copy to clipboard operation
cordova-plugin-add-swift-support copied to clipboard

add SWIFT_COMPILATION_MODE = wholemodule

Open amcalgates opened this issue 1 year ago • 0 comments

This fixes a bug where TestFlight/App Store apps were crashing on iOS 12 when compiled with Xcode 15+.

To reproduce:

  • have a Cordova project that has any Swift file in it (and make sure the Swift file properly belongs to project target)
  • Deployment Target = iOS 12.0
  • Xcode version >= 15 (I was using 15.1)

Then to reproduce:

  • in Xcode go to Product -> Archive and then Distribute to TestFlight + App Store. Witness crash on launch once app reaches your device

OR, to skip waiting on TestFlight/App Store:

  • In Xcode go to Product -> Profile
  • Once "Profile" is done and has installed the app on your device, either launch the app from your iPad/iPhone, or choose "Activity Monitor" when Instruments launches after the "Profile" step finishes, and hit the little red record button top left
  • App should crash on launch

For the aid of future users Googling, this was the only error I could glean, which I saw in the system console. There are no stack traces because the app does not successfully launch on iOS 12:

Attempt to add an app with insufficient id, info {
    BKSApplicationStateAppIsFrontmost = 1;
    BKSApplicationStateExtensionKey = 0;
    SBApplicationStateDisplayIDKey = "com.dinnerwire.SmartKDS";
    SBApplicationStateKey = 8;
    SBApplicationStateProcessIDKey = 472;
    SBApplicationStateRunningReasonsKey =     (
                {
            SBApplicationStateRunningReasonAssertionIdentifierKey = UIApplicationLaunch;
            SBApplicationStateRunningReasonAssertionReasonKey = 10000;
        }
    );
    SBMostElevatedStateForProcessID = 8;
}

And:

SyscallError: setpriority(PRIO_DARWIN_ROLE, 787, 3): No such process

https://forum.ionicframework.com/t/ios-12-app-crashes-on-opening-and-closes-quickly-libswift-concurrency-dylib/230206

amcalgates avatar Jan 12 '24 21:01 amcalgates