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.