【发布时间】: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