Plaid-Java API 2020-09-14 有问题吗?

问题描述 投票:0回答:1

我有以下代码,非常简单:

package com.enrosz;

import java.util.HashMap;

import com.plaid.client.ApiClient;

public class MyPlaid {
    
public static void main(String[] args)  {
        
        HashMap<String, String> apiKeys = new HashMap<String, String>();
        apiKeys.put("clientId", "REDACTED");
        apiKeys.put("secret", "REDACTED");
        apiKeys.put("plaidVersion", "2020-09-14");
        
        ApiClient plaidApiClient = new ApiClient(apiKeys);
        
    }

}

执行时,最后一行立即失败并出现以下错误:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by retrofit2.Platform (file:/Users/enroiv/.m2/repository/com/squareup/retrofit2/retrofit/2.9.0/retrofit-2.9.0.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of retrofit2.Platform
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" java.lang.NoSuchMethodError: 'byte[] kotlin.collections.ArraysKt.copyInto(byte[], byte[], int, int, int)'
    at okio.Segment.writeTo(Segment.kt:169)
    at okio.Segment.compact(Segment.kt:152)
    at okio.Buffer.write(Buffer.kt:1842)
    at okio.Buffer.read(Buffer.kt:1854)
    at okio.Buffer.writeAll(Buffer.kt:1642)
    at okio.Options$Companion.buildTrieRecursive(Options.kt:187)
    at okio.Options$Companion.buildTrieRecursive(Options.kt:174)
    at okio.Options$Companion.buildTrieRecursive$default(Options.kt:113)
    at okio.Options$Companion.of(Options.kt:72)
    at okhttp3.internal.Util.<clinit>(Util.kt:70)
    at okhttp3.HttpUrl$Builder.parse$okhttp(HttpUrl.kt:1239)
    at okhttp3.HttpUrl$Companion.get(HttpUrl.kt:1633)
    at okhttp3.HttpUrl.get(HttpUrl.kt)
    at retrofit2.Retrofit$Builder.baseUrl(Retrofit.java:506)
    at com.plaid.client.ApiClient.createDefaultAdapter(ApiClient.java:156)
    at com.plaid.client.ApiClient.<init>(ApiClient.java:45)
    at com.plaid.client.ApiClient.<init>(ApiClient.java:92)
    at com.enrosz.MyPlaid.main(MyPlaid.java:16)

这似乎是 Plaid 使用的底层库的问题,特别是 okhttp。我无法解决这个问题。联系了 Plaid 支持,但尚未回复。

这很奇怪,因为直到最近这个完全相同的代码一直在工作。不确定是否以某种方式引入了重大更改。

okhttp plaid
1个回答
0
投票

这可能是您使用的 Kotlin 版本的问题。您至少需要使用 Kotlin 1.3。请参阅此处 https://github.com/slackapi/java-slack-sdk/issues/518 和此处 OkHttp: NoSuchMethodError copyInto in TlsUtil

的相关问题
© www.soinside.com 2019 - 2024. All rights reserved.