Android : Error when using AWS Android S3 SDK: Source not found - The JAR of this class file belongs to container 'Android private libraries'

on Saturday, September 20, 2014


I'm working on an Android App with AWS Android SDK, especifically using S3, and I started receiving the following error:



Source not found - The JAR of this class file belongs to container
'Android private libraries' which does not allow modifications to source attachments
on its entries.


that happens on the line



s3Client = new AmazonS3Client(credentials);


when I try to create a new client to connect to S3.


I had to replace an old version of the SDK (1.7.1.1) with a newer version (2.1.0) in order to use PersistableDownload class to pause/resume downloads. I don't understand why is this happening since I'm not trying to change the library. What I remember doing:



- Removed the old library
- Added the new one
- Removed and added again several imports on the start of .java files
- Using an older device for the weekend (android API level 8)


Here is a extend part of the code. That might help.



AWSCredentials credentials = new BasicAWSCredentials(ACCESS_KEY_ID, SECRET_KEY);

Region region = Region.getRegion(regions);

AmazonS3Client s3Client = null;
try {
s3Client = new AmazonS3Client(credentials);
s3Client.setRegion(region);
} catch (Exception e) {
e.printStackTrace();
}
return s3Client;


Any help is aprpreciated to solve this. Thanks!


0 comments:

Post a Comment