What's causing 'function invocation ... expected' in kotlin?

This error suggests you're treating a variable as a function or you forgot to invoke a function.

Example:


fun greet() = "Hello"
println(greet)

Solution:


fun greet() = "Hello"
println(greet())
Ensure you use parentheses when invoking functions.

Beginner's Guide to Kotlin