tommybuonomo / dotsindicator

Three material Dots Indicators for view pagers in Android !
Apache License 2.0
3.41k stars 350 forks source link

DotsIndicator 5.0 causes NullPointerException on SingleLiveData, but 4.3 works fine! #182

Open SantosVithor opened 11 months ago

SantosVithor commented 11 months ago

My project has this SingleLiveData implementation: LiveData with Single Events and, for some reason, the version 5.0 causes a NullPointerException.

More specificly: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference (I often use SingleLiveData as a Boolean type, but in some places they are of type Any, and it also causes the NullPointerException)

It's also valid to add that my project uses Kotlin, but no compose at all (therefore, I'm using xml for views).

I've tried different versions and solutions for this and here are my tests:

PS: by "adding compose", I've considered this Compose Setup and Compose-Kotlin Releases

Another valid observation is that I've faced a lot of compatibility issues while trying to use this lib. At first, I was forced to update my Kotlin version to 1.8.0 and I faced some issues regarding Unit tests with Roboeletric because of that. After solving them, I migrated my Gradle Build Scripts to Kotlin DSL and then, upgraded my gradle from 7.5 to 8.1.

I made those changes because the project was needing it, not because of the problems I faced here. Nevertheless, I found a way through this madhouse and manage to work with this library (amazing btw).