Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ can't resolve com.amazonaws symbols

this may be a very simple question, but I've been stuck on it for hours...

I'm trying to add amazon cloud integrations into my project, and I can't seem to get the project to recognize the jar files. I'm currently simply trying to instantiate an AmazonS3 client:

AmazonS3 s3 = new AmazonS3Client();

I've added this to my build.gradle under dependencies{ }:

compile('com.amazonaws:aws-java-sdk:1.10.6')

When I run gradle build, it looks like it is downloading a bunch of jar files from maven, but when I go to compile my project, I get "symbol not found" errors.

error: cannot find symbol
        AmazonS3 s3 = new AmazonS3Client();
        ^

It seems like gradle isn't adding the classes to my classpath or something. Is there some plugin I need? Do I need to add the jars manually to my project?

Thanks

Edit: I'm using IntelliJ Idea to manage the project.

like image 531
Brian Avatar asked Jul 26 '15 13:07

Brian


1 Answers

Not entirely sure what the problem was before, but I was able to resolve it by:

gradle clean
gradle cleanIdea
gradle idea
...
<import required classes>
...
gradle build

Seems like this resolved it. Something was wrong with the project setup.

like image 181
Brian Avatar answered Sep 22 '22 21:09

Brian