android - 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),);
平台安卓
在良好的网络条件下,它工作正常。
解决方案
推荐阅读
- java-time - Java 8 和 11 在每个平台(Windows、macOS、Linux)中的可用系统时钟精度是多少?
- javascript - LocalStorage 一键与多键
- ruby-on-rails - 在 Rails 6 中设置会话超时 [已解决]
- laravel - GroupBy 来自使用 laravel 雄辩的关系
- excel - 连接或组合多个值并保留字体和颜色
- mediawiki - 使用外部 API 进行 MediaWiki 授权
- split - 使用 Python 将基于符号的文本拆分为多个文件
- sql - 仅在 PostgreSQL 中按月分组查询?
- mongodb - 在指定条件下对数组中对象的值求和
- python - Django runserver 错误 - 冻结 importlib._bootstrap