1

Hi I have created one Android application and created one dynamic feature in it. In this dynamic feature in one of the fragments, I am trying to set a custom font for text view.

ResourcesCompat.getFont(requireContext(), R.font.custom_montserrat_bold)

Here custom_montserrat_bold is present inside the dynamic feature. Inside my activity which hosts this feature fragment I have added the following code

 override fun attachBaseContext(base: Context) {
    super.attachBaseContext(base)
    SplitCompat.installActivity(this)
}

Following is the Android manifest for dynamic feature

<dist:module
    dist:instant="false"
    dist:title="customModule">
    <dist:delivery>
        <dist:install-time />
    </dist:delivery>
    <dist:fusing dist:include="true" />
</dist:module>

I am getting the following error

Fatal Exception: android.content.res.Resources$NotFoundException
Font resource ID #0x7e070001 could not be retrieved.

It is not happening for all devices.

nilkash
  • 7,408
  • 32
  • 99
  • 176
  • I'm trying to implement dynamic feature. I have fragments in my on demand module. It downloads and installs successfully. But then it crashes saying resources not found and points to the line where i inflate the layout. Have you got answer or know the answer to my query? Please do share – Aagam Shah May 31 '22 at 07:27
  • @nilkash Have you found any solution for this ? I m also facing similar problem. Please update if you have got any solution for this. – Bhagya Sep 29 '22 at 07:40

0 Answers0