简体   繁体   中英

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

尝试在dexguard规则中对资产进行模糊处理。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM