JakeWharton / timber

A logger with a small, extensible API which provides utility on top of Android's normal Log class.
https://jakewharton.github.io/timber/docs/5.x/
Apache License 2.0
10.46k stars 962 forks source link

Fatal Exception: java.lang.AssertionError: No NameTypeIndex match for SHORT_STANDARD #404

Closed verma-varsha closed 3 years ago

verma-varsha commented 3 years ago

I am using timber in my app for logging and we have been observing crashes for some users with the following stacktrace:

Fatal Exception: java.lang.AssertionError: No NameTypeIndex match for SHORT_STANDARD
       at android.icu.impl.TimeZoneNamesImpl$ZNames.getNameTypeIndex(TimeZoneNamesImpl.java:724)
       at android.icu.impl.TimeZoneNamesImpl$ZNames.getName(TimeZoneNamesImpl.java:790)
       at android.icu.impl.TimeZoneNamesImpl.getTimeZoneDisplayName(TimeZoneNamesImpl.java:183)
       at android.icu.text.TimeZoneNames.getDisplayName(TimeZoneNames.java:261)
       at java.util.TimeZone.getDisplayName(TimeZone.java:405)
       at java.util.Date.toString(Date.java:1066)
       at java.util.Formatter$FormatSpecifier.printString(Formatter.java:2977)
       at java.util.Formatter$FormatSpecifier.print(Formatter.java:2854)
       at java.util.Formatter.format(Formatter.java:2523)
       at java.util.Formatter.format(Formatter.java:2458)
       at java.lang.String.format(String.java:2770)
       at timber.log.Timber$Tree.formatMessage(Timber.java:539)
       at timber.log.Timber$Tree.prepareLog(Timber.java:525)
       at timber.log.Timber$Tree.i(Timber.java:420)
       at timber.log.Timber$1.i(Timber.java:264)
       at timber.log.Timber.i(Timber.java:53)
       at com.sampleapp.myapp.service.service.LoadSettingsJobService.onStartJob(LoadSettingsJobService.java:54)
       at com.firebase.jobdispatcher.JobService$2.run(JobService.java:164)
       at android.os.Handler.handleCallback(Handler.java:790)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6626)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)

The code fo the line where this is being observed in LoadSettingsJobService.java is as follows:

Timber.i("LoadSettingsJobService.onStartJob: job %s scheduled at %s", jobParameters.getTag(), scheduledTime);

Observed on Android 8, 9, 10 devices with 76% being samsung.

JakeWharton commented 3 years ago

I don't know what the cause is, but it's not Timber. You would see the same exception if you called schemedTime.toString() which would yield the exact same top section of your trace:

Fatal Exception: java.lang.AssertionError: No NameTypeIndex match for SHORT_STANDARD
       at android.icu.impl.TimeZoneNamesImpl$ZNames.getNameTypeIndex(TimeZoneNamesImpl.java:724)
       at android.icu.impl.TimeZoneNamesImpl$ZNames.getName(TimeZoneNamesImpl.java:790)
       at android.icu.impl.TimeZoneNamesImpl.getTimeZoneDisplayName(TimeZoneNamesImpl.java:183)
       at android.icu.text.TimeZoneNames.getDisplayName(TimeZoneNames.java:261)
       at java.util.TimeZone.getDisplayName(TimeZone.java:405)
       at java.util.Date.toString(Date.java:1066)
JakeWharton commented 3 years ago

Perhaps try StackOverflow?

verma-varsha commented 3 years ago

Thank you @JakeWharton for the info. Will have a look.