I am getting this error on the latest version of Android Studio and while I have installed both Android SDK Platform API 25 and Android SDK Build-Tools 25.
As Vishnu said, For me updating Android studio and Gradle didn't fix the problem.
I navigated to Tools -> Android -> SDK Manager and selected BuildTools and checked for the updates related to platform tools. After updating and installing those, fixed my problem.
And for one my friends, the issue got resolved after following the above steps and then navigating to Help->Check for updates-> and installing all the available updates.