Cordova build errors

• 2 min read

Had this unusual errors crop up when building a cordova app for android. This started appearing after I installed cordova-plugin-file-opener2.

ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontVariationSettings
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:ttcIndex

Going through [platforms/android/project.properties] file, I realized that there was something quite odd about it.

cordova.system.library.1=com.android.support:support-v13:26.+
cordova.system.library.2=me.leolin:ShortcutBadger:1.1.17@aar
cordova.system.library.3=com.google.firebase:firebase-messaging:11.0.1
cordova.system.library.4=com.android.support:support-v4:27.1.0
cordova.system.library.5=com.android.support:support-v4:24.1.1+
cordova.system.library.6=com.android.support:support-v4:+

There were multiple versions of the same library being defined.

I removed the last three lines -- library.4, library.5 & library.6, ensuring that the the highest version of [com.android.support:support] and its contents. But I'm assuming it's being used by the build system to do something similar to linking in the traditional C build system).

Anyway voila the problems disappeared!