Hello!
I have a WatchOS Application on TestFlight that is crashing on startup on Apple Watch Series 3 devices (32-bit). It works flawlessly on Simulators (Xcode 11.7) and Apple Watch Series 4. I am using Alamofire 5.2.2 with Swift Package Manager. Latest Xcode (version 11.7). The device is Apple Watch Series 3 devices (32-bit) running latest final watchOS (version 6.2.8).
I am calling a REST service that returns a JSON error file (response) and HTTP status code 401 (Unauthorized) if no gateway access token is given.
As I said this works in simulator and Apple Watch Series 4 device. I suspect of Bitcode, as in the past versions I had an iOS companion app and disabled bitcode generation, but now we only have the watch app and I cannot disable Bitcode generation.
What happened instead?
The crash is somewhat like this:
NOTE
Unfortunately this is a big project for a bank. I do not have yet a demo project because the error only occurs via TestFlight installing on Apple Watch Series 3 (32-bits). Already opened an issue on Alamofire GitHub but they said maybe it is an Apple TestFlight generation (bitcode?) error. < https://github.com/Alamofire/Alamofire/issues/3295 >
I have a WatchOS Application on TestFlight that is crashing on startup on Apple Watch Series 3 devices (32-bit). It works flawlessly on Simulators (Xcode 11.7) and Apple Watch Series 4. I am using Alamofire 5.2.2 with Swift Package Manager. Latest Xcode (version 11.7). The device is Apple Watch Series 3 devices (32-bit) running latest final watchOS (version 6.2.8).
I am calling a REST service that returns a JSON error file (response) and HTTP status code 401 (Unauthorized) if no gateway access token is given.
As I said this works in simulator and Apple Watch Series 4 device. I suspect of Bitcode, as in the past versions I had an iOS companion app and disabled bitcode generation, but now we only have the watch app and I cannot disable Bitcode generation.
What happened instead?
The crash is somewhat like this:
Code Block Hardware Model: Watch3,4 Process: Watch App Extension [616] Version: 132 (1.0) AppVariant: 1:Watch3,4:6 Beta: YES Code Type: ARM (Native) Role: Foreground Parent Process: launchd [1] Date/Time: 2020-09-02 15:52:50.8659 -0300 Launch Time: 2020-09-02 15:52:48.0000 -0300 OS Version: Watch OS 6.2.8 (17U63) Release Type: User Baseband Version: n/a Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x00000060 VM Region Info: 0x60 is not in any region. Bytes before following region: 2310048 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START ---> TEXT 00234000-0038c000 [ 1376K] r-x/r-x SM=COW ...App Extension Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL, Code 0xb Terminating Process: exc handler [616] Triggered by Thread: 0 Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libswiftCore.dylib 0x6f7f4060 static _SetStorage.allocate+ 864352 (scale:age:seed:) + 16 1 libswiftCore.dylib 0x6f7f007e static _SetStorage.allocate+ 847998 (capacity:) + 126 2 Watch App Extension 0x002fcca4 specialized protocol witness for Collection.endIndex.getter in conformance [A] + 822436 (_$s30Watch_App_Extension12SimulaCambioMp:0) 3 Watch App Extension 0x002ebcfe static ResponseSerializer.defaultEmptyRequestMethods.getter + 752894 (contaFormatada.modify:102) 4 Watch App Extension 0x002801e2 AlamofireLoginService.loginSmartwatch(completion:) + 311778 (AlamofireLoginService.swift:49) 5 Watch App Extension 0x0027b568 specialized InterfaceController.doLogin(:semProgresso:) + 292200 (InterfaceController.swift:0) 6 Watch App Extension 0x00275ec6 InterfaceController.awake(withContext:) + 270022 (InterfaceController.swift:246) 7 Watch App Extension 0x00276888 @objc InterfaceController.awake(withContext:) + 272520 (<compiler-generated>:0 8 WatchKit 0x5f1959c2 _WKInterfaceControllerCreateClass + 444 9 WatchKit 0x5f1ceef4 153-[SPRemoteInterface createViewController:className:properties:contextID:info:gestureDescriptions:clientIdentifier:interfaceControllerCreationCompletion:]_block_invoke_3 + 348 10 WatchKit 0x5f1cebbe 153-[SPRemoteInterface createViewController:className:properties:contextID:info:gestureDescriptions:clientIdentifier:interfaceControllerCreationCompletion:]_block_invoke_2 + 1070 11 WatchKit 0x5f194130 spUtils_dispatchAsyncToMainThread + 22 12 WatchKit 0x5f1ce75c 153-[SPRemoteInterface createViewController:className:properties:contextID:info:gestureDescriptions:clientIdentifier:interfaceControllerCreationCompletion:]_block_invoke + 156 13 WatchKit 0x5f1956c4 -[SPRemoteInterface performAfterApplicationDidFinishLaunching:] + 40 14 WatchKit 0x5f195410 -[SPRemoteInterface createViewController:className:properties:contextID:info:gestureDescriptions:clientIdentifier:interfaceControllerCreationCompletion:] + 282 15 WatchKit 0x5f23564a __178-[SPExtensionConnection interfaceViewController:createCompanionControllerClass:properties:initializationContextID:info:gestureDescriptions:interfaceControllerCreationCompletion:]_block_invoke + 294 16 WatchKit 0x5f192ba2 -[SPExtensionConnection performOnSendQueue:syncIfUnsuspended:] + 464 17 WatchKit 0x5f195298 -[SPExtensionConnection interfaceViewController:createCompanionControllerClass:properties:initializationContextID:info:gestureDescriptions:interfaceControllerCreationCompletion:] + 284 18 WatchKit 0x5f1950f4 -[SPApplicationDelegate viewController:createWKInterfaceControllerClass:properties:contextID:creationCompletion:] + 1588 19 WatchKit 0x5f183740 -[SPInterfaceViewController loadView] + 2004 20 UIKitCore 0x678d7aca -[UIViewController loadViewIfRequired] + 160 21 UIKitCore 0x678d80f0 -[UIViewController view] + 24 ... Thread 0 crashed with ARM Thread State (32-bit): r0: 0x00000001 r1: 0x00000000 r2: 0x00000001 r3: 0x00000000 r4: 0x00000001 r5: 0x00000001 r6: 0x000000e4 r7: 0x27bcd708 r8: 0x00000000 r9: 0x00000000 r10: 0x00000000 r11: 0x16db3fd0 ip: 0xfff00000 sp: 0x27bcd670 lr: 0x6f7f007f pc: 0x6f7f4060 cpsr: 0x60000030 Binary Images: 0x234000 - 0x3d3fff Watch App Extension armv7k <53780c55b55534578139202ab803cb6a> /var/containers/Bundle/Application/8D10BAB7-2EDF-4C98-8558-915BEBC0F499/Watch App.app/PlugIns/Watch App Extension.appex/Watch App Extension
NOTE
Unfortunately this is a big project for a bank. I do not have yet a demo project because the error only occurs via TestFlight installing on Apple Watch Series 3 (32-bits). Already opened an issue on Alamofire GitHub but they said maybe it is an Apple TestFlight generation (bitcode?) error. < https://github.com/Alamofire/Alamofire/issues/3295 >