question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ArrayIndexOutOfBoundsException ZoneRules.isFixedOffset

See original GitHub issue

After updating to kotlinx-datetime:0.3.0 I am seeing crashes on Android with the following stacktrace:

java.lang.ArrayIndexOutOfBoundsException: length=0; index=-1 at j$.time.zone.ZoneRules.isFixedOffset at kotlinx.datetime.TimeZone$Companion.ofZone$kotlinx_datetime(SourceFile:47) at kotlinx.datetime.TimeZone$Companion.currentSystemDefault(SourceFile:34)

I am not totally sure where to report this, the crash is introduced due to 0.3.0 making calls to ZoneRules.isFixedOffset. Though by looking at the source code of java.time.zone.ZoneRules here, I can’t see how an ArrayIndexOutOfBoundsException can happen.

I have coreLibraryDesugaring enabled, using com.android.tools:desugar_jdk_libs:1.1.5

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dkhalanskyjbcommented, Oct 4, 2021

Thanks! I managed to reproduce it on an emulator with the API level 24. With the API level 30, everything is fine.

I suppose it’s really up to us to work around this to support older versions, as Google seems to have fixed this already in the newer SDKs.

0reactions
boiler23commented, Oct 23, 2021

Hi guys, could please give some estimate for the next release which fixes this? iosSimulatorArm64 is important to us, but we cannot upgrade to 0.3.0 until this issue is fixed - it generates a lot of crashes in Android production. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ZoneRules - Android Developers
Obtains an instance of ZoneRules that has fixed zone rules. ... public boolean isFixedOffset (). Checks of the zone rules are fixed, such...
Read more >
ZoneRules (Java Platform SE 8 ) - Oracle Help Center
Checks if the specified instant is in daylight savings. boolean, isFixedOffset(). Checks of the zone rules are fixed, such that the offset never...
Read more >
jdk8/jdk8/jdk: 5435f112e5ea - OpenJDK Mercurial Repositories
Pattern; /** - * A builder that can read the TZDB time-zone files and build {@code ZoneRules} instances. + * A compiler that...
Read more >
Diff - platform/frameworks/base - Google Git
ZoneRules getRules(); + method public int getTotalSeconds(); + method public ... Instant); + method public boolean isFixedOffset(); + method public boolean ...
Read more >
java.time.zone.ZoneRules.isFixedOffset java code examples
JdkBasedDateTimeZone.isFixed(). @Override public boolean isFixed() { return zoneRules.isFixedOffset(); }. origin: com.github.seratch/java-time-backport ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found