Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android AWS sdk无法上载_Android_Amazon Web Services - Fatal编程技术网

Android AWS sdk无法上载

Android AWS sdk无法上载,android,amazon-web-services,Android,Amazon Web Services,我已经在MobileHub上创建了应用程序,并集成了android。配置文件位于原始目录中 打完电话 AWSMobileClient.getInstance().initialize(context).execute(); BasicAWSCredentials credentials = new BasicAWSCredentials(ACCESS_KEY, KEY_SECRET); AmazonS3Client s3Client = new AmazonS3Client(credential

我已经在MobileHub上创建了应用程序,并集成了android。配置文件位于原始目录中

打完电话

AWSMobileClient.getInstance().initialize(context).execute();
BasicAWSCredentials credentials = new BasicAWSCredentials(ACCESS_KEY, KEY_SECRET);
AmazonS3Client s3Client = new AmazonS3Client(credentials);

transferUtility = TransferUtility.builder()
                    .context(context.getApplicationContext())
                    .awsConfiguration(AWSMobileClient.getInstance().getConfiguration())
                    .s3Client(s3Client)
                    .build();



TransferObserver uploadObserver =
                            transferUtility.upload(
                                    BUCKET_NAME,
                                    file.getName(),
                                    file);

uploadObserver.setTransferListener(new TransferListener() {
                        @Override
                        public void onStateChanged(int id, TransferState state) {
                            System.out.println("State changed:"+state);
                        }

                        @Override
                        public void onProgressChanged(int id, long bytesCurrent, long bytesTotal) {
                            System.out.println("Progress.."+bytesCurrent);
                        }

                        @Override
                        public void onError(int id, Exception ex) {
                            System.out.println("error:"+ex);
                        }
                    });
我明白了

但当我试图上传任何文件(从public目录和private目录)时,它只触发onProgressChanged一次,TransferState为IN_PROGRESS。没有别的了

如果它无法上传图像,是否应该有一个适当的错误

我的日志:

06-12 14:22:41.873 I:欢迎来到AWS!您已成功连接。
06-12 14:22:41.873 D:AWSMobileClient初始化成功。
06-12 14:22:41.873 I:欢迎来到AWS!您已成功连接。
06-12 14:22:41.877 I:登记接收人
06-12 14:22:41.955 I:状态已更改:正在进行
06-12 14:22:41.960 W:非活动输入连接上的finishComposingText
非活动InputConnection上的finishComposingText
非活动InputConnection上的finishComposingText
06-12 14:22:46.844 V:不活动,与服务断开
06-12 14:22:46.845 I:发送崩溃
06-12 14:23:18.221 V:记录用户参与度,ms:36408
06-12 14:23:18.223 V:连接到远程服务
06-12 14:23:18.230伏:活动暂停,时间:22740592
06-12 14:23:18.237D:日志事件(FE):用户参与(e),捆绑[{firebase事件(o)=自动,参与时间(et)=36408,firebase屏幕(sc)=管理员活动,firebase屏幕(id)=-1968217097067332}]

通过您的logcat@MilanPansuriya您是否在清单中定义了广播接收器?
我只添加了此服务,正如API中所建议的,您使用的是什么设备和Android平台版本?
Welcome to AWS! You are connected successfully.
AWSMobileClient Initialize succeeded.