Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.
This repository was archived by the owner on Aug 22, 2025. It is now read-only.

IllegalStateException: Already initialized #119

Description

@ksc91u
Caused by java.lang.IllegalStateException: Already initialized
       at org.threeten.bp.zone.ZoneRulesInitializer.setInitializer(ZoneRulesInitializer.java:74)
       at com.jakewharton.threetenabp.AndroidThreeTen.init(AndroidThreeTen.java:22)
       at com.jakewharton.threetenabp.AndroidThreeTen.init(AndroidThreeTen.java:17)
       at com.jakewharton.threetenabp.AndroidThreeTen.init(AndroidThreeTen.java:13)
       at com.wave.waveradio.WaveApplication.onCreate(WaveApplication.java:108)

We have seen this exception on some devices since last release.

//jsr310
    implementation 'com.jakewharton.threetenabp:threetenabp:1.2.1'
    testImplementation("org.threeten:threetenbp:1.4.0") {
        exclude module: "com.jakewharton.threetenabp:threetenabp:1.2.1"
    }
//previously added duplicate entry
//testImplementation("org.threeten:threetenbp:1.4.0")

We have tried remove that testImplementation duplicate entry,
try/catch that exception and continue. But new exception occurred.

Fatal Exception: org.threeten.bp.zone.ZoneRulesException: No time-zone data files registered
       at org.threeten.bp.zone.ZoneRulesProvider.getProvider(ZoneRulesProvider.java:165)
       at org.threeten.bp.zone.ZoneRulesProvider.getRules(ZoneRulesProvider.java:122)
       at org.threeten.bp.ZoneRegion.ofId(ZoneRegion.java:143)
       at org.threeten.bp.ZoneId.of(ZoneId.java:358)
       at org.threeten.bp.ZoneId.of(ZoneId.java:286)
       at org.threeten.bp.ZoneId.systemDefault(ZoneId.java:245)
       at org.threeten.bp.Clock.systemDefaultZone(Clock.java:137)
       at org.threeten.bp.LocalDateTime.now(LocalDateTime.java:152)

I have seen two library entry in Android Studio,

org.threeten:threetenbp:1.4.0:no-tzdb@jar
org.threeten:threetenbp:1.4.0@jar

But only 1.4.0@jar version when run ./gradlew app::dependencies 2>&1 1> log2

I have also clear AndroidStudio & gradle caches. Do you know what might cause this issue? Thank you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions