Build Error with Request Location Accuracy Plugin

868 views Asked by At

I am building a Phonegap app using Visual Studio Tools for Apache Cordova.

I am trying to get a native dialog to take user to / enable location services and for the same I am using the Request Location Accuracy Plugin from HERE.

However when I add that plugin from GIT, I get the below build error and I am unable to build the project.

1>  FAILURE: Build failed with an exception.
1>
1>  * What went wrong:
1>  A problem occurred configuring root project 'android'.
1>  > Could not resolve all dependencies for configuration ':_debugCompile'.
1>     > Could not find any version that matches com.google.android.gms:play-services-location:+.
1>       Searched in the following locations:
1>           https://repo1.maven.org/maven2/com/google/android/gms/play-services-location/maven-metadata.xml
1>           https://repo1.maven.org/maven2/com/google/android/gms/play-services-location/
1>       Required by:
1>           :android:unspecified
1>

The config.xml shows the plugin installed as below statement is present in the config.xml.

  <plugin name="cordova-plugin-request-location-accuracy" version="1.0.1" />

Any Help would be greatly appreciated.

PS - I have already enabled Google Play services in the SDK Manager.

2

There are 2 answers

1
Ashutosh Vyas On BEST ANSWER

Added another "EXTRA" and now it builds successfully. Looks like we also need to add "Android Support Repository" which in the latest versions of SDK manager is known as "Local Maven Repository for Support Libraries".

Once I added that, it worked fine and I can build the application perfectly.

1
Shri On

I raised this issue on the github repository of cordova-plugin-request-location-accuracy and Mr. Dave Alden responded within no time. He has updated the project's README.

IMPORTANT: This plugin depends on the Google Play Services library, so you must install the "Google Repository" package under the "Extras" section in Android SDK Manager. Otherwise the build will fail.

So install "Google Repository" under "Extras" in your SDK manager if you haven't yet and try building again.

screenshot of sdk manager

Once have a look at the updated documentation of the repository