Search code examples
androidcordovabuildapkphonegap

Phonegap build apk fails with FontFamilyFont errors


I'm using https://build.phonegap.com to build my apk and ipa file.

I create the zip package and update it, then I download apk/ipa.

From today I have a trouble: the apk file isn't compiled, I can see errors in the log (while the ipa is generated).

Note I didin't change anything on Android settings, I think there is an Android update causing this.

The Phonegap log says (this is only the trailer):

BUILD FAILED

Total time: 4.069 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 FontFamilyFont, unable to find attribute android:font

ERROR: In FontFamilyFont, unable to find attribute android:fontStyle

ERROR: In FontFamilyFont, unable to find attribute android:fontVariationSettings

ERROR: In FontFamilyFont, unable to find attribute android:fontWeight ERROR: In FontFamilyFont, unable to find attribute android:ttcIndex

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':processDebugResources'.

    com.android.ide.common.process.ProcessException: Failed to execute aapt

I work with DevExtreme, a Phonegap based platform, so the working solutions for pure Phonegap should be ok for my project too.

My config.xml is

<widget id="com.devexpress.apptemplate" version="1.0" versionCode="1">
  <name>ApplicationTemplate</name>
  <description>Template</description>
  <author email="info@info.com" href="http://www.info.com/">Info</author>
  <preference name="permissions" value="none" />
  <preference name="prerendered-icon" value="true" />
  <preference name="phonegap-version" value="cli-7.0.1" />
  <icon src="icon/ios/icon.png" width="1024" height="1024" />
  <preference name="android-windowSoftInputMode" value="adjustPan" />
  <preference name="SplashScreenDelay" value="3000" />
  <preference name="AutoHideSplashScreen" value="true" />
  <preference name="SplashShowOnlyFirstTime" value="false" />
  <preference name="FadeSplashScreen" value="false" />
  <preference name="ShowSplashScreenSpinner" value="false" />
  <preference name="DisallowOverscroll" value="true" />
  <preference name="StatusBarOverlaysWebView" value="false" />
  <preference name="StatusBarStyle" value="default" />
  <feature name="StatusBar">
    <param name="ios-package" value="CDVStatusBar" onload="true" />
  </feature>
  <preference name="StatusBarBackgroundColor" value="#000000" />
  <preference name="android-minSdkVersion" value="15" />
  <preference name="android-targetSdkVersion" value="26" />
  <platform name="android">
    <resource-file src="google-services.json" target="google-services.json" />
  </platform>
  <platform name="ios">
    <resource-file src="GoogleService-Info.plist" />
  </platform>
  <plugin name="cordova-plugin-geolocation" spec="2.4.1" />
  <plugin name="cordova-plugin-inappbrowser" />
  <plugin name="cordova-plugin-splashscreen" onload="true" />
  <plugin name="cordova-plugin-whitelist" />
  <plugin name="cordova-plugin-ios-longpress-fix" />
  <!--<plugin name="cordova-plugin-statusbar" onload="true" />-->
  <plugin name="phonegap-plugin-push" spec="2.0.0" />
  <plugin spec="https://github.com/Telerik-Verified-Plugins/BarcodeScanner.git" source="git">
    <param name="CAMERA_USAGE_DESCRIPTION" value="To scan barcodes." />
  </plugin>
  <plugin name="cordova-plugin-camera" spec="^2.4.1" source="npm">
    <variable name="CAMERA_USAGE_DESCRIPTION" value="This app requires access to take picture and send them, if needed." />
    <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="This app requires access to the photo library to send them, if needed." />
  </plugin>
  <access origin="*" />
  <!--<engines>
    <engine name="android" spec="^6.3.0" />
  </engines>-->
</widget>

Solution

  • I found the magic trick to solve this.

    I added this in my config.xml:

    <plugin name="cordova-android-support-gradle-release">
         <variable name="ANDROID_SUPPORT_VERSION" value="26.0.0"/>
    </plugin>
    

    And changed targetSdkVersion to 26:

    <preference name="android-targetSdkVersion" value="26"/>