adamint / spotify-web-api-kotlin

Spotify Web API wrapper for Kotlin, Java, JS, and Native - Targets JVM, Android, JS (browser), Native (Desktop), and Apple tvOS/iOS. Includes a Spotify Web Playback SDK wrapper for Kotlin/JS, and a spotify-auth wrapper for Kotlin/Android.
https://adamint.github.io/spotify-web-api-kotlin-docs/
MIT License
194 stars 21 forks source link

Add a note about Java8 API desugaring on Android #291

Closed hufman closed 3 years ago

hufman commented 3 years ago

Thank you for the excellent library! It underpins the seamless Spotify integration in my app, and I truly appreciate the hard work in designing an ergonomic API!

Some of my users on Android version 7 (API24) phones have experienced some crashes in Utils.getCurrentTimeMs after upgrading from spotify-api-kotlin-android:3.5.02 to spotify-api-kotlin-android:3.7.0. I think Java8 API desugaring is one way to fix it, so here's a link to instructions on how to enable it.

Would it be possible to go back to using DateTime.nowUnixLong() or to use System.currentTimeMillis() directly for Android builds at least? I think this commit is when it changed, and I can provide a PR, but wasn't sure what the context was.

adamint commented 3 years ago

Hey @hufman, Thanks for the pr and the note! I’m happy that my project can play a small role in your great app. I wrongly assumed that kotlinx.datetime would avoid java.time APIs, and testing didn’t alert me to that issue. I will release a version that directly uses System.currentTimeMillis as well.

hufman commented 3 years ago

Thank you so much for the quick response! ❤️

adamint commented 3 years ago

No problem! Let me know if you find any other issues.