Cannot resolve theme reference in Android Studio

Issue

I’ve recently added a light and darkmode theme to my android app, this works great in the app itself but in the design view on Android Studio, all elements like textviews, imageviews etc are all white and have this message: cannot resolve theme reference ?attr/textcustom

This goes for text, images, backgrounds. All with the same error

One of the many errors

In this image you see all buttons, text etc are white. But when opening the app they get the correct colors etc.
Image of design view

Solution

Try changing the preview theme, the option is located right on top of the design panel:
Android Studio

Answered By – CHAN

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published