Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Render problem: font does not exist (or is not a file)

On Android Studio Dolphin 2021.3.1 SDK 33, out of the blue, I've encountered a render problem error with any web font: "File app/src/main/res/font/rubik_bold.xml does not exist (or is not a file)".

Refreshing the layout doesn't help. I've tried clean and rebuild, Gradle sync and invalidating the cache. Nothing worked. The font is preloaded, the file exists. The folder is accessible. The files are not corrupted or anything. I've even deleted the font files and redownloaded them via Android Studio Design view.

like image 922
Victor Marcoianu Avatar asked Nov 17 '25 21:11

Victor Marcoianu


2 Answers

The issue has been partially fixed on Electric Eel 2022.1.1 Patch 1. You have to delete the font folder and redownload the font.

The easiest way is to go to a layout file, go to Design, select a text box and in the fontFamily attribute, select More Fonts. Search for the font family you wish and install all missing fonts.

Refresh the layout by clicking the "Try to refresh the layout" option if it does not load by itself.

like image 78
Victor Marcoianu Avatar answered Nov 19 '25 13:11

Victor Marcoianu


From the history at https://issuetracker.google.com/issues/248473636, it appears that this issue has been addressed in Electric Eel Beta 4 and Flamingo Canary 7.

like image 29
Mark Avatar answered Nov 19 '25 12:11

Mark