I have a watch app that is working OK with watchOS 6. It uses AlamoFire 5 for networking.
Testing it with watchOS 7, it gives this error "Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." if I disable Certificate Pinning (PinnedCertificatesTrustEvaluator).
If I enable it, the error is "Code=-67820 "Certificate 2 “Trusted Root CA SHA256 G2” has errors: Certificate is revoked;".
The same certificate I use on the app on watchOS 6 and it was generated with the openssl command (openssl sclient -connect <SITEURL>:443 </dev/null | openssl x509 -outform DER -out cert.der).
I have nothing related to networking configured in a .plist.
Someone knows what's changed in watchOS 7 or need to be done in Alamofire 5 ?
Thank you in advance!
Post
Replies
Boosts
Views
Activity
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:
Hardware Model:&#9;&#9;&#9;Watch3,4
Process:&#9;&#9;&#9;&#9;&#9;&#9; Watch App Extension [616]
Version:&#9;&#9;&#9;&#9;&#9;&#9; 132 (1.0)
AppVariant:&#9;&#9;&#9;&#9;&#9;1:Watch3,4:6
Beta:&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;YES
Code Type:&#9;&#9;&#9;&#9;&#9; ARM (Native)
Role:&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Foreground
Parent Process:&#9;&#9;&#9;launchd [1]
Date/Time:&#9;&#9;&#9;&#9;&#9; 2020-09-02 15:52:50.8659 -0300
Launch Time:&#9;&#9;&#9;&#9; 2020-09-02 15:52:48.0000 -0300
OS Version:&#9;&#9;&#9;&#9;&#9;Watch OS 6.2.8 (17U63)
Release Type:&#9;&#9;&#9;&#9;User
Baseband Version:&#9;&#9;n/a
Report Version:&#9;&#9;&#9;104
Exception Type:&#9;EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000060
VM Region Info: 0x60 is not in any region.&#9;Bytes before following region: 2310048
&#9;&#9;&#9;REGION TYPE&#9;&#9;&#9;&#9;&#9;&#9;&#9;START - END&#9;&#9; [ VSIZE] PRT/MAX SHRMOD&#9;REGION DETAIL
&#9;&#9;&#9;UNUSED SPACE AT START-->&#9;
&#9;&#9;&#9;__TEXT&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 00234000-0038c000 [ 1376K] r-x/r-x SM=COW&#9;...App Extension
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [616]
Triggered by Thread:&#9;0
Thread 0 name:&#9;Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0&#9; libswiftCore.dylib&#9;&#9;&#9;&#9;&#9;&#9; 0x6f7f4060 static _SetStorage.allocate+ 864352 (scale:age:seed:) + 16
1&#9; libswiftCore.dylib&#9;&#9;&#9;&#9;&#9;&#9; 0x6f7f007e static _SetStorage.allocate+ 847998 (capacity:) + 126
2&#9; Watch App Extension 0x002fcca4 specialized protocol witness for Collection.endIndex.getter in conformance [A] + 822436 (_$s30Watch_App_Extension12SimulaCambioMp:0)
3&#9; Watch App Extension 0x002ebcfe static ResponseSerializer.defaultEmptyRequestMethods.getter + 752894 (contaFormatada.modify:102)
4&#9; Watch App Extension 0x002801e2 AlamofireLoginService.loginSmartwatch(completion:) + 311778 (AlamofireLoginService.swift:49)
5&#9; Watch App Extension 0x0027b568 specialized InterfaceController.doLogin(:semProgresso:) + 292200 (InterfaceController.swift:0)
6&#9; Watch App Extension 0x00275ec6 InterfaceController.awake(withContext:) + 270022 (InterfaceController.swift:246)
7&#9; Watch App Extension 0x00276888 @objc InterfaceController.awake(withContext:) + 272520 (<compiler-generated>:0
8&#9; WatchKit&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x5f1959c2 _WKInterfaceControllerCreateClass + 444
9&#9; WatchKit&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x5f1ceef4 __153-[SPRemoteInterface createViewController:className:properties:contextID:info:gestureDescriptions:clientIdentifier:interfaceControllerCreationCompletion:]_block_invoke_3 + 348
10&#9;WatchKit&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x5f1cebbe __153-[SPRemoteInterface createViewController:className:properties:contextID:info:gestureDescriptions:clientIdentifier:interfaceControllerCreationCompletion:]_block_invoke_2 + 1070
11&#9;WatchKit&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x5f194130 spUtils_dispatchAsyncToMainThread + 22
12&#9;WatchKit&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x5f1ce75c __153-[SPRemoteInterface createViewController:className:properties:contextID:info:gestureDescriptions:clientIdentifier:interfaceControllerCreationCompletion:]_block_invoke + 156
13&#9;WatchKit&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x5f1956c4 -[SPRemoteInterface performAfterApplicationDidFinishLaunching:] + 40
14&#9;WatchKit&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x5f195410 -[SPRemoteInterface createViewController:className:properties:contextID:info:gestureDescriptions:clientIdentifier:interfaceControllerCreationCompletion:] + 282
15&#9;WatchKit&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x5f23564a __178-[SPExtensionConnection interfaceViewController:createCompanionControllerClass:properties:initializationContextID:info:gestureDescriptions:interfaceControllerCreationCompletion:]_block_invoke + 294
16&#9;WatchKit&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x5f192ba2 -[SPExtensionConnection performOnSendQueue:syncIfUnsuspended:] + 464
17&#9;WatchKit&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x5f195298 -[SPExtensionConnection interfaceViewController:createCompanionControllerClass:properties:initializationContextID:info:gestureDescriptions:interfaceControllerCreationCompletion:] + 284
18&#9;WatchKit&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x5f1950f4 -[SPApplicationDelegate viewController:createWKInterfaceControllerClass:properties:contextID:creationCompletion:] + 1588
19&#9;WatchKit&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x5f183740 -[SPInterfaceViewController loadView] + 2004
20&#9;UIKitCore&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x678d7aca -[UIViewController loadViewIfRequired] + 160
21&#9;UIKitCore&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x678d80f0 -[UIViewController view] + 24
...
Thread 0 crashed with ARM Thread State (32-bit):
&#9;&#9;r0: 0x00000001&#9;&#9;r1: 0x00000000&#9;&#9;&#9;r2: 0x00000001&#9;&#9;&#9;r3: 0x00000000
&#9;&#9;r4: 0x00000001&#9;&#9;r5: 0x00000001&#9;&#9;&#9;r6: 0x000000e4&#9;&#9;&#9;r7: 0x27bcd708
&#9;&#9;r8: 0x00000000&#9;&#9;r9: 0x00000000&#9;&#9; r10: 0x00000000&#9;&#9; r11: 0x16db3fd0
&#9;&#9;ip: 0xfff00000&#9;&#9;sp: 0x27bcd670&#9;&#9;&#9;lr: 0x6f7f007f&#9;&#9;&#9;pc: 0x6f7f4060
&#9;cpsr: 0x60000030
Binary Images:
0x234000 - 0x3d3fff Watch App Extension armv7k&#9;<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 >