Google Play Services in Ionic Android project - Geolocation API

I am trying to make this plugin work with my ionic app:

This plugin needs Google Play Services installed to work.

I have installed it through android SDK and followed this steps in order to get the library included into my project:

https://developer.android.com/tools/projects/projects-cmdline.html#ReferencingLibraryProject

Now if I try to build android project I get:

FAILURE: Build failed with an exception.

 What went wrong:
A problem occurred configuring root project 'android'.
> Cannot evaluate module google-play-services_lib : Configuration with name 'debug' not found.

From some research It seems like that this problem is related to project structure and gradle, but I can’t figure out how to solve it. Can anybody help me?

I can also evaluate different free background gps plugins to run into my ionic app.

Thank you