Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio canary 5 update error

Tags:

android

Error:(249, 5) duplicate value for resource 'attr/font' with config '' Error:(249, 5) resource previously defined here

Error:java.lang.RuntimeException: com.android.builder.internal.aapt.AaptException: AAPT2 compile failed:

like image 504
Tarun Koshta Avatar asked Jul 06 '17 09:07

Tarun Koshta


2 Answers

I guess you implemented an attr.xml file with a line <attr name="font">. Since Android 8.0 comes with a new feature called 'Fonts in XML' this might be the reason for your Error. You could change the name of the attribute to e.g. <attr name="font_name"> and probably in all your custom views and layout xmls, too. Or just use the new feature ;)

like image 62
Peppermint Paddy Avatar answered Sep 22 '22 21:09

Peppermint Paddy


Try adding in your gradle.properties

android.enableAapt2=false
like image 25
AndroidRuntimeException Avatar answered Sep 20 '22 21:09

AndroidRuntimeException