I am trying to access my s3 buckets from my java application, trying to implement this
https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/examples-s3-buckets.html
I've added the lib/aws-java-sdk-1.8.6.jar to my lib folder and added the dependency in my pom.xml as well.
I still get this import error
"The import com.amazonaws.services.s3.AmazonS3ClientBuilder cannot be resolved" for "import com.amazonaws.services.s3.AmazonS3ClientBuilder;"
Whereas the imports
"import com.amazonaws.services.s3.AmazonS3;" and "import com.amazonaws.services.s3.model.Bucket;" gave no errors.
Any help would be appreciated. I found some people trying to implement for Android ran in similar issues but not this exactly
I was having the same issue, and after some research I realized that AmazonS3ClientBuilder is not part from AWS Android SDK instead of that the class is part of AWS JAVA SDK so you have to include this on your dependencies:
implementation 'com.amazonaws:aws-java-sdk:1.11.404'
Definitely the dependency as mentioned in Amazon documentation did not work. The path to the dependency does not exist, in Maven central repository.
"software.amazon.awssdk" % "aws-java-sdk" % "2.0.0"
The following too, did not resolve com.amazonaws.services.s3.AmazonS3ClientBuilder, though the JAR path is correct in Maven central -
"software.amazon.awssdk" % "aws-sdk-java" % "2.1.3"
I had to fallback to the following as mentioned in the previous comment.
"com.amazonaws" % "aws-java-sdk" % "1.11.465"
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