You need to update your Google Play services and Google repository from the standalone SDK manager.
First open Android Studio and click this icon on the top toolbar:

Then, when the dialog box starts, click on “Launch Offline SDK Manager” at the bottom left of the dialog box:

To make sure that nothing but what we want is updated / installed, click "Cancel All":

When the Standalone SDK Manager window opens, find "Extras" and collapse it. You should see "Google Play Services" and "Google Repository", and on the right you will see "Available Update: {something}". Select them for the items and click Install.

When they are completed, the error will disappear.
Ab_
source share