mikepenz/Android-Iconics

Disabling AppStartup silently breaks the library

Nek-12 opened this issue · 3 comments

About this issue

  1. Follow Official Google guide on workmanager
  2. The guide says "If you do not use AppStartup in your project, you can disable it"
    Note: I also use Koin for DI and it has its own custom init mechanism for workmanager, which is why I disabled AppStartup.
  3. Disable AppStartup in the manifest
  4. Iconics no longer resolves icons for any of the default font typefaces when trying to use their string representation e.g. "gmr_near_me", but works when using .getIcon()
    Side effects:
  • Resolving fails silently, no warnings are given because icon(String) extension function uses ?.let { } which ignores unresolved typefaces and only reports icon resolution errors
  • No warnings or error are given that appStartup is disabled.

Checklist

Proposed solution:

  1. Mention AppStartup in the README
  2. Log typeface resolution errors in logcat
  3. Crash the app if init script has not been run properly. (Fail Early)

Thank you very much for the report @Nek-12
I'll add a note in the README to highlight the usage of jetpack startup library

@mikepenz Why have you decided to ignore font resolution errors in the code?
In this file on line 42 you do not give a warning. Is that intended and if yes, what's the reason behind?

@Nek-12 that was mainly a historic matter, adding a log for the next release.