Sagar Bandamwar
Sagar Bandamwar

Reputation: 227

Calligraphy font not getting applied In release build of Android app with dexguard

I have used this popular calligraphy library Calligraphy

I have integrated Dex-guard in my project

it works fine with the proguardFile getDefaultDexGuardFile('dexguard-debug.pro')

whenever i create release build with the proguardFile getDefaultDexGuardFile('dexguard-release.pro')

i got this error in log-cat at the time of creating release build

: Can't create asset from fonts/Gotham/Gotham-Bold.otf. Make sure you have passed in the correct path and file name.
java.lang.RuntimeException: Font asset not found fonts/Gotham/Gotham-Bold.otf
    at android.graphics.Typeface.createFromAsset(Typeface.java:310)
    at uk.co.chrisjenx.calligraphy.TypefaceUtils.load(:35)
    at uk.co.chrisjenx.calligraphy.CalligraphyUtils.applyFontToTextView(:114)
    at uk.co.chrisjenx.calligraphy.CalligraphyUtils.applyFontToTextView(:143)
    at uk.co.chrisjenx.calligraphy.CalligraphyFactory.onViewCreatedInternal(:142)
    at uk.co.chrisjenx.calligraphy.CalligraphyFactory.onViewCreated(:110)

altough i have also added following rules as all we know dexguard obsfucate files

-keep class uk.co.chrisjenx.calligraphy. { ; } -keep class uk.co.chrisjenx.calligraphy.$ { ; } -keep class uk.co.chrisjenx.calligraphy. { ; }

but in my case it didn't worked

Any help is appreciated although i tried removing and adding fonts i have also tried with the .ttf format as well .otf format

Upvotes: 0

Views: 215

Answers (1)

Nikhil BHadouria
Nikhil BHadouria

Reputation: 23

Try obfuscation of assets in dexguard rules.

Upvotes: 0

Related Questions