Skip to content Skip to sidebar Skip to footer

Android Aws S3 Sdk Transferutility Not Working In Service

I am trying to use the AWS Android SDK for S3 in a started service. I am a little new to both the SDK and Services. I am pretty confident that the Transfer Utility is also running

Solution 1:

I found myself in the same issue... Here it is what solved for me:

I noticed I had the following service for my SyncAdapter registered in Manifest:

<serviceandroid:name=".sync.SyncService"android:exported="true"android:process=":sync"><intent-filter><actionandroid:name="android.content.SyncAdapter"/></intent-filter><meta-dataandroid:name="android.content.SyncAdapter"android:resource="@xml/syncadapter" /></service>

The android:process=":sync" tells service to run in a private process called :sync So I just told the TransferService from Amazon SDK to run in this same thread.

<serviceandroid:name="com.amazonaws.mobileconnectors.s3.transferutility.TransferService"android:process=":sync"android:enabled="true" />

After that, I no more got the error TransferService can't get s3 client, and it will stop, and finally was able to upload my pictures to S3

Solution 2:

You should declare the client as a global variable, as the garbage collector could delete it if you don't do it.

Post a Comment for "Android Aws S3 Sdk Transferutility Not Working In Service"