AWS Amplify Network error on Watch OS device

I have created a voice recorder application for watch only app in xcode. The logic is when the user stops the recording, the recorded audio file is transferred red to AWS S3 bucket.

The code is working fine when I run the app on Xcode Watch OS simulator.

But when I install it on the physical watch, every time it is giving network error. I have added all the required permissions and also pinged a basic website and it returned as OK.

Amplify Framework Version 2.17.1

Amplify Categories Storage

Dependency manager Swift PM

Swift version 5.8

CLI version 12.4.0

Xcode version 14+

LOGS:

🔍 File exists, proceeding with upload.
🔍 Network available: true
🔍 Uploading Recording_09-10-2023_22-51-23_966
🔍 Data size: 43304 bytes
2023-09-10T22:51:34-0500 info CognitoIdentityClient : [Logging] Request: POST https:443
Path: / Content-Type: application/x-amz-json-1.1, User-Agent: aws-sdk-swift/1.0 api/cognito-identity/1.0 os/watchOS/9.6.1 lang/swift/5.8 lib/amplify-swift/2.17.1, Content-Length: 79, x-amz-user-agent: aws-sdk-swift/1.0, / Host: cognito-identity.us-east-2.amazonaws.com, / X-Amz-Target: AWSCognitoIdentityService.GetId / Optional([]) 2023-09-10T22:51:34-0500 info SerialExecutor : [Logging] Creating connection pool for Optional("https://cognito-identity.us-east-2.amazonaws.com/?%22)with max connections: 50 / 🛑 Full error object: StorageError: The operation couldn’t be completed. (AwsCommonRuntimeKit.CommonRunTimeError error 0.) Recovery suggestion: Check your network connection, retry when the network is available. HTTP Response stauts code: nil 🛑 Storage error: The operation couldn’t be completed. (AwsCommonRuntimeKit.CommonRunTimeError error 0.). Check your network connection, retry when the network is available.

The code is working fine when I run the app on Xcode Watch OS simulator.

But when I install it on the physical watch, every time it is giving network error.

That’s not uncommon. watchOS places significant restrictions on low-level networking. See TN3135 Low-level networking on watchOS. However, the error you’re getting suggests that the code is using HTTP, which means that it should be possible to get it working on watchOS.

It’s hard to say exactly what’s going on without knowing more about the third-party library you’re using. Do you have source code for it? If so, I recommend that you step through the code to work out what Apple API is failing. If not, your only option is to discuss this with the vendor.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

AWS Amplify Network error on Watch OS device
 
 
Q