com.android.tools.r8.errors.CompilationError: Program type already present: androidx.annotation.AnimRes

After struggling and struggling and looking for help here and there, I discovered that ./gradlew app:dependencies command was providing important output to solve the error. First of all, the error is Program type already present: androidx.annotation.AnimRes Program type already present means there is a naming conflict, and in this case the androidx.annotation library, which is … Read more

Deep copy of list with objects in Kotlin

That’s bacause you are adding all the object references to another list, hence you are not making a proper copy, you have the same elements in two list. If you want diferents list and diferent references, you must clone every object in a new list: public data class Person(var n: String) fun main(args: Array<String>) { … Read more

MockK “io.mockk.MockKException: no answer found for:” error

In your case you mocked the classes being tested. You have two options: get rid of mockk for loginPresenter, just use original object and set properties use spyk to create spy. This is something in between original object and mock The exception is throw because mocks are strict by default, it just do not know … Read more

Identity equality for arguments of types Int and Int is deprecated

You can change the code by using structual equality instead as below: // use structual equality instead —v if (visibility and View.SYSTEM_UI_FLAG_FULLSCREEN == 0) { decorView.systemUiVisibility = flags } Why don’t suggest to use referential equality? you can see my answer here. On the other hand, when you use referential/identity equality maybe return false, for … Read more