Home » Android » Android studio canary 5 update error

Android studio canary 5 update error

Posted by: admin June 15, 2020 Leave a comment

Questions:

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:

How to&Answers:

Try adding in your gradle.properties

android.enableAapt2=false

Answer:

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 😉