In my app I'm using Guava library. I have referenced it in my build.gradle
file only as follows:
dependencies {
compile 'com.google.guava:guava:13.0.1'
}
My app rebuilds and runs fine. However when I'm trying to add a new something from Guava library then the compiler complains that it can't find the class.
For example: when I write
import com.google.common.base.Preconditions
in my new file the compiler says 'cannot resolve symbol common'
.
But my old files are rebuilt fine. How so? Do I have to mess with Project|Structure
? I specifically wanted to list any dependencies -only- in build.gradle
.
It seems that doing a "sync project with gradle files" helps.
In Android Studio, select :
Tools > Android > Sync project with gradle files
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