Custom Font not working on Android Fragment
<pre><code>public class HomeFragment extends Fragment {

    public HomeFragment(){}

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_home, container, false);
        Typeface font = Typeface.createFromAsset(getActivity().getAssets(), "font/Montserrat-Bold.ttf");
        TextView txt = (TextView) rootView.findViewById(R.id.tv);
        txt.setTypeface(font);

        return rootView;
    }
}
</code></pre>

<p>I have this on my fragment initializing a Typeface, but i get this error on my Log.</p>

<pre><code>05-20 19:54:25.464 15739-15739/com.braudy.android.mesasixprofiler E/AndroidRuntime: FATAL EXCEPTION: main Process: com.braudy.android.mesasixprofiler, PID: 15739
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.braudy.android.mesasixprofiler/com.braudy.android.mesasixprofiler.MainActivity}: java.lang.RuntimeException: Font asset not found font/Montserrat-Bold.ttf
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.RuntimeException: Font asset not found font/Montserrat-Bold.ttf
at android.graphics.Typeface.createFromAsset(Typeface.java:190)
at com.braudy.android.mesasixprofiler.HomeFragment.onCreateView(HomeFragment.java:26)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:742)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:339)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:601)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1237)
at android.app.Activity.performStart(Activity.java:6253)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
at android.app.ActivityThread.-wrap11(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5417) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
</code></pre>

<p>I'm getting a "Font asset not found font/Montserrat-Bold.ttf" error.</p>

<p>I also setup the files in their correct folders. And tried rebuild and clean project nothing works.<a href="https://i.stack.imgur.com/5TznY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5TznY.png" alt="enter image description here"></a></p>