首页 > 解决方案 > AWS Flutter SocketTimeoutException 在低网络条件下

问题描述

我正在尝试在我的颤动应用程序中使用来自 pub.dev 的官方 Amazon S3 插件将图像上传到 Amazon S3 存储桶,但是在低网络上,我在错误日志中得到了这个

E/amplify:flutter:storage_s3(23398): StorageException
E/amplify:flutter:storage_s3(23398): StorageException{message=Something went wrong with your AWS S3 Storage upload file operation, cause=com.amazonaws.AmazonClientException: Unable to execute HTTP request: SSL handshake timed out, recoverySuggestion=See attached exception for more information and suggestions}
E/amplify:flutter:storage_s3(23398): at com.amplifyframework.storage.s3.operation.AWSS3StorageUploadFileOperation$UploadTransferListener.onError(AWSS3StorageUploadFileOperation.java:203)

W/.marketwork.de(23398): Accessing hidden field Lsun/misc/Unsafe;->theUnsafe:Lsun/misc/Unsafe; (greylist, reflection, allowed)
W/.marketwork.de(23398): Accessing hidden method Lsun/misc/Unsafe;->allocateInstance(Ljava/lang/Class;)Ljava/lang/Object; (greylist, reflection, allowed)
I/flutter (23398): UploadFile Err: StorageException(message: Something went wrong with your AWS S3 Storage upload file operation, recoverySuggestion: See attached exception for more information and suggestions, underlyingException: com.amazonaws.AmazonClientException: Unable to execute HTTP request: SSL handshake timed out)

我的代码是:

await AmplifyStorageS3.instance.uploadFile(request:UploadFileRequest(local: image, key: imageKey, options: options),);

平台安卓

在良好的网络条件下,它工作正常。

标签: androidamazon-web-servicesflutterdartamazon-s3

解决方案


推荐阅读