Get the following error when building a project with PhoneGap Build after adding the cordova-background-geolocation-lt plugin:
:processArmv7DebugResourcesERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontStyle
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontWeight
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processArmv7DebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 4.171 secs
Error: /gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontStyle
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontWeight
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processArmv7DebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
at ChildProcess.whenDone (/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
My config.xml looks like this (redacted):
<?xml version="1.0" encoding="UTF-8" ?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" id=“[..]” versionCode="[..]" versionName="[..]" version="[..]">
<preference name='phonegap-version' value='cli-7.0.1' />
<name>[..]</name>
<description>[..]</description>
<author href="[..]" email="[..]">[..]</author>
<content src="index.html" />
<icon src="res/icon/ios/icon-72@2x.png" />
<preference name="FullScreen" value="false" />
<preference name="webviewbounce" value="false" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="FadeSplashScreen" value="false"/>
<preference name="AutoHideSplashScreen" value="false" />
<platform name="android">
<preference name="xwalkMultipleApk" value="false" />
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
<gap:config-file parent="/manifest/application">
android:windowSoftInputMode="adjustPan"
</gap:config-file>
<preference name="LoadUrlTimeoutValue" value="700000" />
<preference name="android-build-tool" value="gradle" />
<preference name="CodePushDeploymentKey" value="[..]" />
</platform>
<feature name="Device">
<param name="ios-package" value="CDVDevice" />
<param name="android-package" value="org.apache.cordova.device.Device" />
</feature>
<feature name="File">
<param name="ios-package" value="CDVFile" />
<param name="android-package" value="org.apache.cordova.file.FileUtils" />
</feature>
<feature name="FileTransfer">
<param name="ios-package" value="CDVFileTransfer" />
<param name="android-package" value="org.apache.cordova.filetransfer.FileTransfer" />
</feature>
<!-- Cordova plugins -->
<plugin name="cordova-plugin-camera" spec="~2.3.1">
<variable name="CAMERA_USAGE_DESCRIPTION" value="[..]" />
<variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="[..]" />
</plugin>
<plugin name="cordova-plugin-device" source="npm" spec="1.1.2" />
<plugin name="cordova-plugin-geolocation" spec="2.4.3">
<variable name="GEOLOCATION_USAGE_DESCRIPTION" value="[..]" />
</plugin>
<plugin name="cordova-plugin-inappbrowser" source="npm" spec="1.3.0" />
<plugin name="cordova-plugin-network-information" source="npm" spec="1.2.0" />
<plugin name="cordova-plugin-vibration" source="npm" spec="2.1.0" />
<plugin name="cordova-plugin-media" source="npm" spec="2.2.0" />
<plugin name="cordova-plugin-screen-orientation" source="npm" version="v1.4.1" />
<plugin name="cordova-plugin-splashscreen" source="npm" version="3.2.2" />
<plugin name="cordova-plugin-statusbar" source="npm" spec="2.1.3" />
<plugin name="cordova-plugin-file-transfer" source="npm" spec="1.5.1" />
<plugin name="cordova-plugin-file" source="npm" spec="4.2.0" />
<plugin name="cordova-sqlite-storage" source="npm" version="0.8.5" />
<plugin name="cordova-plugin-code-push" source="npm" version="v1.9.3-beta" />
<plugin name="ionic-plugin-keyboard" source="npm" version="v2.2.0" />
<plugin name="phonegap-plugin-barcodescanner" source="npm" version="5.0.0" />
<plugin name="uk.co.workingedge.phonegap.plugin.launchnavigator" source="npm" spec="3.1.1" />
<plugin name="cordova-plugin-crosswalk-webview" spec="~2.3.0" />
<plugin name="cordova-plugin-email" source="npm" version="1.1.1" />
<plugin name="cordova-plugin-appavailability" spec="^0.4.2" />
<plugin name="com.xmartlabs.cordova.market" spec="https://github.com/xmartlabs/cordova-plugin-market" />
<plugin name="cordova-plugin-x-socialsharing" spec="^5.1.8" />
<plugin name="cordova-background-geolocation-lt" source="npm" version="2.8.5" />
</widget>
This problem has been encounted before:
- https://github.com/transistorsoft/cordova-background-geolocation-lt/issues/507
- https://forum.ionicframework.com/t/android-build-broken-after-gradle-dependencies-update-execution-failed-for-task-processdebugresources-com-android-ide-common-process-processexception-failed-to-execute-aapt/109982/2
- unable to find attribute android:font for v7 support
- https://github.com/mauron85/react-native-background-geolocation/issues/116
- https://forums.adobe.com/thread/2405676
The generally accepted advice is that com.android.support:support-v4:27
is causing the problem, so if you have com.android.support:support-v4:+
, then you should specify com.android.support:support-v4:23.+
.
However, I haven't got this to work as of yet. I've tried to adding this line:
<framework src="com.android.support:support-v4:23+" value="gradle" />
But that doesn't seem to have an effect for me.
I have cross posted this on the plugins issue tracker: https://github.com/transistorsoft/cordova-background-geolocation-lt/issues/563
And on the PhoneGap Build forum: https://forums.adobe.com/message/10028062
Any help would be appreciated.