hi guys, I have a free function like this: ```fun ...
# android
e
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
blah.blah.blah.DataLayer.APICommunicatorKt.addQueryStrings
What is wrong here? Is there anything wrong with using free function here? (note: it does not happen on all devices)
m
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