Clock.System.now() fails on Android SDK less than 26
See original GitHub issueHi!
Call of Clock.System.now() fails with java.lang.NoClassDefFoundError: kotlinx.datetime.Instant() on Android 7 and earlier because Instant() was added to SDK in version 26.
Should I provide platform-specific implementation instead?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to fix "Call requires API level 26 (current min is 25) ...
You need to use https://github.com/JakeWharton/ThreeTenABP to be able using LocalDateTime with Android API < 26. Add the dependencies to ...
Read more >Migrating to Android 8.0
If your app receives location updates from a background service, it receives less frequent updates on Android 8.0 (API level 26) compared to...
Read more >Emulator release notes | Android Developers
Linux emulator now uses KVM paravirtualized clock when the guest kernel version is >= 5.4 (R system images or later). Emulator now uses...
Read more >Android 8.0 Behavior Changes
These behavior changes apply to all apps when they run on the Android 8.0 (API level 26) platform, regardless of the API level...
Read more ><uses-sdk> | Android Developers
The Android system will prevent the user from installing the application if the system's API Level is lower than the value specified in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
WeSeems I’ve found a solution:
coreLibraryDesugatorby official documentation,kotlinx.datetimeto android dependencies.Android 6 does not crash anymore. Thank you for your help. This issue can be closed.
Well, I reproduces the problem a little bit incorrecly. There is full stacktrace from my main project:
I see, the same supressed
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.time.Instant", but explicitly added kotlinx.datetime` to android gradle does not solve the problem.Update tried to add
kotlinx.datetimeexplicitly at github I provided does not fix the problem as well. Probably, I’ve imported the library incorrectly?