This problem has been addressed hundreds of times here but I haven't still solved it.
I have tried everything available on Stack Overflow and everywhere else:
- Build -> Clean Project; Build -> Rebuild Project
- Tools -> Android -> Sync Project with Gradle files
- Update SDK Manager (it wasn't updated)
- Add
import android.R
andimport android.R.*
But now I don't know what to do.
(Posted on behalf of the OP).
I had to update to buildToolsVersion "21.1.2".