I am a newbie using AWS sdk for video transfer.But i am getting the error "Failed to read S3TransferUtility please check your setup or awsconfiguration.json file". Here is my code.
In my manifest file i have
<service android:name="com.amazonaws.mobileconnectors.s3.transferutility.TransferService" android:enabled="true" />
In my oncreate i am doing this.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_upload_post);
AWSMobileClient.getInstance().initialize(this).execute();
transferUtility =
TransferUtility.builder()
.context(this)
.awsConfiguration(AWSMobileClient.getInstance().getConfiguration())
.s3Client(new AmazonS3Client(AWSMobileClient.getInstance().getCredentialsProvider()))
.build();
}
The exception comes at .build. I debugged the code and it picks up the config file located at in folder perfectly cause i can see the data in debug but i think the transferutility.TransferService is not running. Can someone please help. Thanx
For some reason the auto generated "awsconfiguration" file doesn't include the most important section called "S3TransferUtility". So you have to add it manually. Your "awsconfiguration.json" file should look something like this:
{
"UserAgent": "MobileHub/1.0",
"Version": "1.0",
"CredentialsProvider": {
"CognitoIdentity": {
"Default": {
"PoolId": "us-east-1:<RANDOM-GUID>",
"Region": "us-east-1"
}
}
},
"IdentityManager": {
"Default": {}
},
"PinpointAnalytics": {
"Default": {
"AppId": "<UNIQUE ID>",
"Region": "us-east-1"
}
},
"PinpointTargeting": {
"Default": {
"Region": "us-east-1"
}
},
"S3TransferUtility": {
"Default": {
"Bucket": "<YOUR BUCKET NAME>",
"Region": "us-east-1"
}
}
}
In my awsconfiguration.json i add below lines then it's started working
"S3TransferUtility": {
"Default": {
"Bucket": "<YOUR BUCKET NAME>",
"Region": "us-east-1"
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With