【问题标题】:Calligraphy font not getting applied In release build of Android app with dexguard在带有 dexguard 的 Android 应用程序的发布版本中未应用书法字体
【发布时间】:2019-09-05 10:07:07
【问题描述】:

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

我在我的项目中集成了 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 格式

【问题讨论】:

    标签: android android-studio kotlin dexguard calligraphy


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多