I have updated my android studio to 2.2 preview 1 and applied the specified dependencies for google and firebase as specified but still getting the following error
Just use latest Android Studio 3.1.3 or new if available. You will not get this error.
You can update the Google repository in the Android Software Development Kit (SDK). The fastest way to do it to click:
Help> Check for updates