Issue when using a custom font - "native typeface cannot be made"
Solution 1:
My problem was incorrect placement of the assets folder.
When using Android Studio the assets folder should be inside of the source sets e.g.
src/main/assets/
Found in this answer
Solution 2:
The font file is either corrupt or unsupported for some reason. You can drop it on the SD card and load it from file, to make sure it's not a problem with your assets.
Solution 3:
There are basically 4 things that can cause this:
- You use the wrong extension
- You have to place the fonts in the assets folder and not inside assets/fonts/
- You misspelled the fonts
- The fonts need to be lowercase (in my case the solution was to rename MyFont.ttf to myfont.ttf, strange)
Solution 4:
Double check the extension isn't in caps, ie. suralist_font.TTF
Fonts often come seem to come that way and it might be overlooked.
Solution 5:
I had this same problem, I created mine in assets>fonts>whatever.ttf and was getting the same error. I added the fonts extension (fonts/whatever.ttf) and it fixed the problem in every case.
holder.tv_SuraName =(TextView)convertView.findViewById(R.id.Start_Name);
holder.tv_SuraName.setTypeface(Typeface.createFromAsset(mContext.getAssets(), "fonts/suralist_font.ttf"));