Store: [BUG] Crash in Store 4.0 with Kotlin 1.5.0-RC

Describe the bug Application crash after update Kotlin from 1.4.32 to 1.5.0-RC, no other changes in code.

Catch Exception:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: ru.superapplication.android.app.debug, PID: 18674
    java.lang.NoSuchMethodError: No static method getHours(I)D in class Lkotlin/time/DurationKt; or its super classes (declaration of 'kotlin.time.DurationKt' appears in /data/app/~~l_eMNOPYSnv8XUlDP7ycgA==/ru.superapplication.android.app.debug-ziiU-phO368T6tA7R1CseQ==/base.apk!classes33.dex)
        at com.dropbox.android.external.store4.StoreDefaults.<clinit>(StoreDefaults.kt:15)
        at com.dropbox.android.external.store4.RealStoreBuilder.<init>(StoreBuilder.kt:91)
        at com.dropbox.android.external.store4.StoreBuilder$Companion.from(StoreBuilder.kt:76)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 30 (13 by maintainers)

Most upvoted comments

Thanks folks. I will do the release tomorrow (famous last words)

Yup. It auto closed. Good callout. Snapshot is deployed

Shouldn’t this bug stay OPEN till there is a release for this fix? (SNAPSHOT builds are not a releases)

Hi friends, once we merge https://github.com/dropbox/Store/pull/273 we will have a new snapshot: 4.0.2-KT15-SNAPSHOT This version should be compatible with kotlin 1.5. I expect to have the snapshot out by end of day (EST)

There doesn’t seem to be a way to support both 1.4 and 1.5. I am going to generate a snapshot tomorrow morning… Store4k15:4.0.0-Snapshot (will figure out how to name properly).

We will then carry both versions until we can upgrade to kotlin 1.5 internally. We are currently blocked by a few third party sdks.

Thank you all for the patience, this was a learning experience for me to not leak experimental apis.

Will redo this weekend

@digitalbuddha I have the same issue with Kotlin 1.5.0 like described @bishiboosh. I think it related with Duration-type variable, in Kotlin 1.4 rawValue after compile is Double, but in 1.5 it is Long. Store compiled with 1.4.10 and when try to use Store with Kotlin 1.5 we have crash (type incompatible). My opinion, the 2 way to solve this problem:

  1. compile Store with Kotlin 1.5, but we will have crash when use Store with Kotlin 1.4
  2. remove usage Duration-type.

I still seem to have the same issue, any idea why ? I have this crash :

java.lang.NoSuchMethodError: No static method toDuration(ILjava/util/concurrent/TimeUnit;)D in class Lkotlin/time/DurationKt; or its super classes (declaration of 'kotlin.time.DurationKt' appears in /data/app/com.enki.Enki750g-cJ-mwUBphcam5o5DgtJjRg==/base.apk!classes19.dex)
        at com.dropbox.android.external.store4.StoreDefaults.<clinit>(StoreDefaults.kt:16)
        at com.dropbox.android.external.store4.RealStoreBuilder.<init>(StoreBuilder.kt:91)
        at com.dropbox.android.external.store4.StoreBuilder$Companion.from(StoreBuilder.kt:76)

Got wrapped up will do today.

@digitalbuddha I think removing Duration completely from the lib would be too much of an API change, I’d go with compiling Store with Kotlin 1.5 (and making it a breaking change like you first thought in #265)

@digitalbuddha with the release of 1.5.0 today, do you think you’d be able to release a version so we can migrate safely ?

Hi friends, we won’t be able to release until next week. We are working on fixing the codecov vulnerability prior to triggering any more releases.

Yup makes sense. I will have a fix up this week. I was contemplating dropping duration as dependency all together

On Sun, Apr 18, 2021, 3:49 AM Ihor Kushnirenko @.***> wrote:

@digitalbuddha https://github.com/digitalbuddha I think this crash related with https://blog.jetbrains.com/kotlin/2021/04/kotlin-1-5-0-rc-released/#duration-api-changes

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dropbox/Store/issues/263#issuecomment-821949903, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCRPXH65PQYU7AMRAQDKULTJKFIBANCNFSM424HRFFA .

Thanks will take a look tomorrow