cannot resolve the symbol R : Not a duplicate of http://stackoverflow.com/questions/31071568/cannot-resolve-the-symbol-r-in-android-studio and related questions to above.

i am trying to use the location services in my app. I am following the tutorials http://www.androidwarriors.com/2015/10/fused-location-provider-in-android.html and also the google android developer guide on how to setup google apis.

after changing gradle and manifest, i encounter the error that the symbol R can not be resolved.
i added the following line to gradle app file

    compile 'com.google.android.gms:play-services:9.4.0'

and this line to manifest

    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
 i tried

cleaning project
restarting android studio
sync project with gradle 
re importing the packages
among others to be tried

i am not sure why is this apeparing and how to fix it.