Hey guys I just encountered a weird bug(?) when us...
# android
g
Hey guys I just encountered a weird bug(?) when using
Map.forEach
in Android. The reported exception is
java.lang.NoClassDefFoundError  com.example.packagename.AdManager$executeQueuedCalls$1
I found the solution on stackoverflow already, https://stackoverflow.com/a/51215937/7684435 My code looked like this before the fix:
grouped.forEach { type, interactions -> TODO("placeholder") }
, and the kotlin compiler chose the
Map.forEach(BiConsumer<? super K, ? super V> action)
, which uses
java.util.function.BiConsumer
which isn't available on Android < 8 Oreo. Occured with kotlin version 1.2.30, also with 1.2.61, using this gradle config:
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
I am not sure if this would be considered a bug or not
d
g
okay thanks for the references