Closed danielkpl2 closed 1 year ago
Thanks for sharing, I'll relay this to our SDK team and update this with any new info.
I'm getting this error when trying to call the createCustomer and createCustomerAsync API calls from SDK version 18.3.0.20220316 In my case it seems to be mapping to buildDeleteCustomerRequest.
UPDATE: I tried knocking back the SDK release version in my POM and found that 17.0.0.20211117 is when the createCustomerAsync works. All of the releases since then fail with the NoSuchMethod error.
I managed to fix the issue by explicitly adding the okhttp dependency. It seems that other dependencies in my project also used okhttp, but a different version.
Here is a snippet from my pom.xml file
<dependency>
<groupId>com.squareup</groupId>
<artifactId>square</artifactId>
<version>25.0.1.20221019</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.10.0</version>
</dependency>
I hope this helps anyone else who encounters this problem.
Maybe the SDK team and add something in the documentation to point this out.
The Square SDK Pom file no longer has okHTTP as a dependency. If members of the community run into this error or similar again, feel free to reopen.
Most of your newer square library versions (including 6.5.0.20201028, 7.0.0.20201118, 8.0.0.20201216, 8.1.0.20210121) reference an old version of okhttp3 3.8.1 which doesn't have the callTimeout method in OkHttpClient.Builder which causes the error:
Temporary solution is to exclude the okhttp3 library from com.squareup.square and include a newer version of okhttp3:
A permanent solution would be to include a newer version of okhttp3 in com.squareup.square.