0

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!

Edit: I forgot to say that I tried rolling back the old library and that gives me the same error. Most annoying part is that it was working before.

Vini.g.fer
  • 11,639
  • 16
  • 61
  • 90
  • Does it have anything to do with this? http://stackoverflow.com/questions/10075453/the-jar-of-this-class-file-belongs-to-container-android-dependencies-which-doe – Richard Fung Sep 23 '14 at 00:48
  • The error message yes, but the solutions didn't worked for me. I didn't performed any updates on ADT. – Vini.g.fer Sep 23 '14 at 10:24

2 Answers2

0

I believe this is related to the Android version. During the weekend I was using a cell with version 2.2.3, and now I'm using another device with version 4.4.4.

Version 1.7.1 of the SDK had no S3 issues with Android 2.2.3. Already posted a issue on the gitHub project and if/when the developers reply I'll update this.

Vini.g.fer
  • 11,639
  • 16
  • 61
  • 90
0

the minimum version for the Android SDK is API level 10 which is 2.3.3. Also, yesterday we just released a new version that is considered our General Availability release taking version 2 of our SDK out of developer preview! I've added a post to GitHub to clarify the issue over there as well!

WestonE
  • 682
  • 3
  • 7