Skip to content
Latchkey

Kotlin "None of the following functions can be called" in CI

Overload resolution failed: none of the candidate overloads accepts the argument types you passed. The compiler lists the candidates it considered.

What this error means

The build fails with None of the following functions can be called with the arguments supplied, followed by the candidate signatures. It is deterministic.

gradle
e: file:///src/main/kotlin/App.kt:14:9 None of the following functions
can be called with the arguments supplied:
public fun println(message: Any?): Unit
public fun println(message: Int): Unit

Common causes

Argument types do not match any overload

A nullable, wrongly typed, or extra argument means no candidate signature fits.

Ambiguous numeric or nullable types

A nullable value or an unexpected numeric type (Long vs Int) excludes the overloads you intended.

How to fix it

Match an overload exactly

Convert or unwrap the argument so it fits one candidate signature.

App.kt
val n: Int = count ?: 0
println(n)

Read the candidate list

  1. Compare your argument types against each listed candidate.
  2. Convert the argument to the type a candidate accepts.
  3. Add an explicit cast or named argument to disambiguate.

How to prevent it

  • Pass arguments whose types match an overload.
  • Resolve nullability before the call.
  • Use named arguments for clarity on overloaded APIs.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →