Assets folder in android app (eclipse)
26,442
Solution 1
The problem is at the path of asset
<App Name>/src/assets/fonts/
should be
<App Name>/assets/fonts/
Read more at Directory Structure of an Android Project
Android project directory structure is as below
Solution 2
In Android Studio, I tried the root "app" folder, and that didn't work. I looked for the AndroidManifest.xml file and put the assets folder there. That worked for me.
For me it ended up being app\src\main\assets
Solution 3
ProjectName/assets/fonts
Not in under the src
.
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on October 13, 2020Comments
-
Admin over 3 years
I had searched to create the assets folder in an android app, the solution which i had tried is
<App Name>/src/assets/fonts/
but when i try to use a ttf file in my Application, i have an error :
the code :
mFace = Typeface.createFromAsset(mContext.getAssets(),"fonts/fontType.ttf");
and the error :
native typeface cannot be made
I don't know if the assets folder is in the good place.
-
schnatterer over 7 yearsThe official android developer resources tell something different, though. See also this great answer.
-
Pankaj Kumar over 7 years@schnatterer That is different because that answer is targeted to gradle and this answer is targeted to eclipse based project.
-
schnatterer over 7 yearsI couldn't figure that from the question, so I added it to the title.