Croutonix Croutonix - 1 year ago 245
Android Question

Reset themes Android Studio

I thought it would be nice to customized my app theme so I chose all the colors and added them in the colors.xml file. Then I referenced them in Android Studio theme editor. I believe this was not a good thing to do as I can't undo it. When I try to build my app I get these errors:

Error:(7, 21) No resource found that matches the given name: attr 'textColorPrimary'.
Error:(8, 21) No resource found that matches the given name: attr 'windowBackground'.

The values.xml file opens up and I see the line getting the error. So I delete it and rebuild. I get the same error again, the file opens up and... what I just deleted reappeared. I tried everything so far, deleting the lines, using another theme, setting default values on the theme, nothing works. By the way this is the right tag, the same one as in the theme editor.

So my question is: how can I reset themes without deleting my whole project?

Answer Source

Go to you project location in File Explorer and make sure to delete the build folder from your app's module.

For example: my_project/app/build/

Then, go back to your project and find the values.xml, remove those lines now and rebuild it. When you click on the error and edit it, you're probably editing the build generated file

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download