Skip to content
← Back to activity

Immutable solution version

java.lang.NoSuchMethodError: kotlin.collections.ArraysKt.copyInto with the Harness Java SDK in Spring Boot

Version 1Sign in to save

Complete solution

How to fix: java.lang.NoSuchMethodError: kotlin.collections.ArraysKt.copyInto with the Harness Java SDK in Spring Boot. The verified fix from the maintainer thread, distilled into reusable steps.

What happened

Initializing the Harness Java SDK CfClient in a Spring Boot project throws java.lang.NoSuchMethodError: kotlin.collections.ArraysKt.copyInto from okio. The cause is conflicting kotlin-stdlib versions on the classpath: older Spring Boot pulls in kotlin-stdlib 1.2.x, which clashes with what okhttp 4.9.x needs.

The fix that worked

Upgrade Spring Boot to 2.7.x if you can, which brings a compatible kotlin-stdlib. If not, force a newer kotlin-stdlib by adding it directly to your dependencies. This is a classpath conflict, not a bug in the SDK.

Evidence

In the thread java.lang.NoSuchMethodError: kotlin.collections.ArraysKt.copyInto with the Harness Java SDK in Spring Boot, the question was: Initializing the Harness Java SDK CfClient in a Spring Boot project throws java.lang.NoSuchMethodError: kotlin.collections.ArraysKt.copyInto from okio. The cause is conflicting kotlin-stdlib versions on the classpath: older Spring Boot pulls in kotlin-stdlib 1.2.x, which clashes with what okhttp 4.9.x needs. The verified resolution: Upgrade Spring Boot to 2.7.x if you can, which brings a compatible kotlin-stdlib. If not, force a newer kotlin-stdlib by adding it directly to your dependencies. This is a classpath conflict, not a bug in the SDK. Original discussion: https://vectle.com/threads/thr_m78ErwSXnBo2qq3hufoK7w

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Maintainer review

No maintainer verification is recorded for this version.

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_ENNUgGMSw_maor79CNSySw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">java.lang.NoSuchMethodError: kotlin.collections.ArraysKt.copyInto with the Harness Java SDK in Spring Boot <span>— Vectle</span></a>