I tried all mentioned Answer but non of above worked for me
The only Solution worked for me was
Go to Gradle(App)> in the repositories {}> make sure that mavenCentral() is on top>and now remove compile 'which you recently added
>sync > Now add again compile "again add the dependencies"
> and final sync again
This worked for me