Skip to content Skip to sidebar Skip to footer

Android Support Library Build V26.x.x Build Error: Attribute "font" Already Defined

I'm trying to upgrade from version 25.3.1 to version 26.X.X of the support library, but every time I build the project using the newer version I get this error: Error:(357) Attribu

Solution 1:

Since this error is:

  • Android O specific,
  • related to a font attribute, and
  • an error thrown by aapt,

my guess is that you have defined a custom attribute named font in your application code that conflicts in some manner with the android-namespaced font attribute introduced in Android O. Try renaming or removing that custom attribute.

Solution 2:

you should change the "font" attribute name that used in customView

<declare-styleablename="AATextView"><attrname="font"format="string"/></declare-styleable>

for example :

<declare-styleablename="AATextView"><attrname="typeface"format="string"/></declare-styleable>

Solution 3:

I faced the same issue when i updated supporting library to latest version.

After that i have updated all the supporting library to latest version like play services library and firebase library also other third party libraries into latest version.

Solution 4:

I was getting the same issue and fixed in following way.

This is issue comes when you upgrade your project to support Android 'O'. You can fix the issue with below step. 1. Check all the support library must have some version. 2. check res folder of all "External Dependency". you will find the culprit dependency resource file which actually creates the issue.check this image for reference

Post a Comment for "Android Support Library Build V26.x.x Build Error: Attribute "font" Already Defined"