AAPT: error: resource android:attr/fontVariationSettings not found

Hey,

just tried to run a build today and ran into this issue. I initially didn’t do any updates or anything, just tried to run a build.

C:\Users*****.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\1f8a271632158355256c8b823247a330\res\values\values.xml:246:5-69: AAPT: error: resource android:attr/fontVariationSettings not found.

C:\Users*****.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\1f8a271632158355256c8b823247a330\res\values\values.xml:246:5-69: AAPT: error: resource android:attr/ttcIndex not found.

*****\platforms\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:231: error: resource android:attr/fontVariationSettings not found.
*****\platforms\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:231: error: resource android:attr/ttcIndex not found.
error: failed linking references.

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

I’ve spent the past day looking around for ideas on what I’m supposed to do to fix it. I’ve tried updating cordova, updating some plugins, removing/cleaning the android platform and I can’t seem to figure out what exactly is causing the issue (I’ve been going between this error and a Merge error with appcompat and something called androidX).

From what I can gather fontVariationSettings was introduced in the android v28 API but I’m not too sure what exactly is happening or why this issue is happening now.

I have a feeling my environment in general is a little messed up now from updating/reverting things but this is what I’m at now:

ionic info:

cli packages: (C:\Users*****\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.1.9
Cordova Platforms  : android 7.0.0
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v8.9.4
npm               : 5.6.0
OS                : Windows 10

Environment Variables:

ANDROID_HOME : C:\Users\*****\AppData\Local\Android\Sdk

Misc:

backend : pro

project.properties:

target=android-26
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.system.library.1=com.android.support:support-v4:24.1.1+
cordova.system.library.2=com.android.support:appcompat-v7:26.+
cordova.system.library.3=com.google.android.gms:play-services-analytics:+

plugins:

cordova-plugin-camera 2.4.1 “Camera”
cordova-plugin-compat 1.2.0 “Compat”
cordova-plugin-datepicker 0.9.3 “DatePicker”
cordova-plugin-device 1.1.7 “Device”
cordova-plugin-file 6.0.1 “File”
cordova-plugin-file-opener2 2.0.19 “File Opener2”
cordova-plugin-file-transfer 1.7.1 “File Transfer”
cordova-plugin-filechooser 1.0.1 “File Chooser”
cordova-plugin-filepath 1.0.2 “FilePath”
cordova-plugin-geolocation 4.0.1 “Geolocation”
cordova-plugin-google-analytics 1.8.3 “Google Universal Analytics Plugin”
cordova-plugin-inappbrowser 1.7.2 “InAppBrowser”
cordova-plugin-ionic-webview 1.2.1 “cordova-plugin-ionic-webview”
cordova-plugin-ionic-wkkeyboard 1.1.15 “cordova-plugin-ionic-wkkeyboard”
cordova-plugin-network-information 1.3.4 “Network Information”
cordova-plugin-splashscreen 4.1.0 “Splashscreen”
cordova-plugin-statusbar 2.4.2 “StatusBar”
cordova-plugin-whitelist 1.3.3 “Whitelist”
cordova-sqlite-storage 2.3.1 “Cordova sqlite storage plugin”

3 Likes

Managed to get it to build:

changes/added/removed the following plugins:

cordova-plugin-androidx (add)
cordova-plugin-androidx-adapter (add)
cordova-plugin-camera (updated)
cordova-plugin-compat (remove)

changed the target in project.properties to:

target=android-28

project.properties by the end:

target=android-28
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.system.library.1=androidx.legacy:legacy-support-v4:1.0.0
cordova.system.library.2=androidx.appcompat:appcompat:1.0.0
cordova.system.library.3=com.google.android.gms:play-services-analytics:+
cordova.system.library.4=androidx.legacy:legacy-support-v4:1.0.0

Still have no idea why it even started trying to use androidx. The app was building just fine a few weeks ago and I hadn’t changed anything. Oh well, it’s using it now I guess…

1 Like