xgouchet / Elmyr

A utility to make Kotlin/Java tests random yet reproducible
Other
83 stars 3 forks source link

Library is not compatible with Android SDK version lower than 24 #12

Closed vitusortner closed 6 years ago

vitusortner commented 6 years ago

I'm running into problems using your library for instrumented Android tests on devices running Android SDK version 21 and 23, when calling the Forger.aSentence() function.

The problem is caused by the Integer.min() function, which has only been added in Android version 24. So devices running older versions of Android are lacking the implementation.

I would suggest using the kotlin.math.min() function instead, which also uses Java's Math.min() under the hood.

Apart from that I enjoy using your library. Keep up the good work!

The error I got: java.lang.NoSuchMethodError: No static method min(II)I in class Ljava/lang/Integer; or its super classes (declaration of 'java.lang.Integer' appears in /system/framework/core-libart.jar) at fr.xgouchet.elmyr.Forger.aSentence(Forger.kt:755) at fr.xgouchet.elmyr.Forger.aSentence$default(Forger.kt:735) ...