I have installed cordova-plugin-mauron85-background-geolocation
But the build fails on android with this message and I cant figure out whats wrong.
Here is the error message from the phonegap build log.
Where: Build file '/project/build.gradle' line: 253
What went wrong: A problem occurred evaluating root project 'project'.
Could not get unknown property 'GOOGLE_PLAY_SERVICES_VERSION' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
This is my config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="no.twn.androidapp" version="1.0.6" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>temp</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="[email protected]" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<preference name="phonegap-version" value="cli-6.5.0" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="15" />
<preference name="android-build-tool" value="gradle" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<engine name="ios" spec="^4.4.0" />
<engine name="android" spec="^6.3.0" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
<plugin name="cordova-plugin-mauron85-background-geolocation" spec="^2.3.3">
<variable name="GOOGLE_PLAY_SERVICES_VERSION" value="+" />
<variable name="ICON" value="@mipmap/icon" />
<variable name="SMALL_ICON" value="@mipmap/icon" />
<variable name="ACCOUNT_NAME" value="@string/app_name" />
<variable name="ACCOUNT_LABEL" value="@string/app_name" />
<variable name="ACCOUNT_TYPE" value="$PACKAGE_NAME.account" />
<variable name="CONTENT_AUTHORITY" value="$PACKAGE_NAME" />
<variable name="ALWAYS_USAGE_DESCRIPTION" value="This app always requires location tracking" />
</plugin>
</widget>
I've been struggling to run this plugin in Phonegap Build these days as well and here are my findings:
Unfortunately the 2.3.x versions seems to work only on v2.6.0 android which is not supported yet. Try using v2.2.5 of the plugin, is seems to be working in PB (since version 3 of this plugin is not yet released in cordova repo).