I’m encountering a problem with a straightforward piece of code written in Java where I attempt to initialize the Plaid API client. Here’s the code snippet:
package com.example;
import java.util.HashMap;
import com.plaid.client.ApiClient;
public class PlaidTest {
public static void main(String[] args) {
HashMap<String, String> keys = new HashMap<>();
keys.put("clientId", "REDACTED");
keys.put("secret", "REDACTED");
keys.put("apiVersion", "2020-09-14");
ApiClient client = new ApiClient(keys);
}
}
However, when I run the program, I immediately face this error on the last line:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by retrofit2.Platform...
Exception in thread "main" java.lang.NoSuchMethodError: 'byte[] kotlin.collections.ArraysKt.copyInto(byte[], byte[], int, int, int)'
...
It seems to stem from issues with the libraries backing Plaid, particularly okhttp. I haven’t resolved this yet, and I’m awaiting a response from Plaid support. It’s surprising because this code was functioning properly until recently, and I’m curious if a breaking change might have been introduced. My POM includes the following dependencies:
<dependency>
<groupId>com.plaid</groupId>
<artifactId>plaid-java</artifactId>
<version>16.2.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.11.0</version>
</dependency>