hi guys, I have a free function like this: ```fun ...
# android
hi guys, I have a free function like this:
Copy code
fun addQueryStrings(keyValues: Map<String, String>, baseUrl: String): String {
    var url = baseUrl + "?"
    val firstKey = keyValues.keys.first()

    keyValues.forEach { key, value ->
        if (key != firstKey) { url += "&" }

        url += "$key=$value"

    return url
and I've received several crash report with this error:
Copy code
Fatal Exception: java.lang.NoClassDefFoundError
What is wrong here? Is there anything wrong with using free function here? (note: it does not happen on all devices)
Don’t know if you already got an answer on this one but map.forEach(key, value -> …) is Java 8 so it would fail on older Android versions. Use map.forEach( (key, value) -> …) should do the trick