Android "font asset not found" error

Roymunson picture Roymunson · Mar 25, 2016 · Viewed 11.6k times · Source

I am developing for Android version 22.

I am getting the runtime exception "Font asset not found"

Here is the code:

Typeface customFont =    Typeface.createFromAsset(getAssets(), "fonts/norwester.otf");

And here is my file structure:

First part of file structure

Second part of file stucture

3rd part of file structure

I am guessing that my file structure is wrong because the "assets" folder does not show up in "Android" mode and only shows up in "Project Mode".

What is the problem?

Answer

sandeepmaaram picture sandeepmaaram · Mar 25, 2016

Assets folder should be under root directory of main folder which inner folder of src.

For Reference Please find attached images of folder structure.

enter image description here

enter image description here