First, open your application module build.gradle file.
Check the classpath according to your project dependency. If not change the version of this classpath.
from:
classpath 'com.android.tools.build:gradle:1.0.0'
To:
classpath 'com.android.tools.build:gradle:2.3.2'
or higher version according to your gradle of android studio.
If its still problem, then change buildToolsVersion:
From:
buildToolsVersion '21.0.0'
To:
buildToolsVersion '25.0.0'
then hit 'Try again' and gradle will automatically sync. This will solve it.