mikepenz / Android-Iconics

Android-Iconics - Use any icon font, or vector (.svg) as drawable in your application.
https://mikepenz.dev
Apache License 2.0
5.16k stars 619 forks source link

Disabling AppStartup silently breaks the library #609

Closed Nek-12 closed 2 years ago

Nek-12 commented 2 years ago

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)
mikepenz commented 2 years ago

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

Nek-12 commented 2 years ago

@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?

mikepenz commented 2 years ago

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