0

我用过这个流行的书法库 书法

我在我的项目中集成了 Dex-guard

它适用于proguardFile getDefaultDexGuardFile('dexguard-debug.pro')

每当我使用 proguardFile getDefaultDexGuardFile('dexguard-release.pro') 创建发布版本时

在创建发布版本时,我在 log-cat 中遇到了这个错误

: 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)

尽管我还添加了以下规则,因为我们都知道 dexguard 混淆文件

- 继续上课 uk.co.chrisjenx.calligraphy。{ ; } -keep class uk.co.chrisjenx.calligraphy。$ { ; } -keep class uk.co.chrisjenx.calligraphy。{ ; }

但就我而言,它没有用

任何帮助表示赞赏,尽管我尝试删除和添加我也尝试使用 .ttf 格式以及 .otf 格式的字体

4

1 回答 1

0

尝试混淆 dexguard 规则中的资产。

于 2019-09-05T10:45:20.083 回答