在添加cordova-background-geolocation-lt插件后使用PhoneGap Build构建项目时出现以下错误:
: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)
我的config.xml看起来像这样(编辑):
<?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>
此问题已在以下版本中加入:
普遍接受的建议是com.android.support:support-v4:27
导致问题,因此如果您有com.android.support:support-v4:+
,则应指定com.android.support:support-v4:23.+
。
但是,到目前为止我还没有这个工作。我试图添加这一行:
<framework src="com.android.support:support-v4:23+" value="gradle" />
但这似乎对我没有影响。
我已经在插件问题跟踪器上发布了这个:https://github.com/transistorsoft/cordova-background-geolocation-lt/issues/563
在PhoneGap Build论坛上:https://forums.adobe.com/message/10028062
任何帮助都将不胜感激。