java.lang.NoSuchMethodError: 'okhttp3.RequestBody okhttp3.RequestBody.create(byte[], okhttp3.MediaType)'
See original GitHub issueHello,
after upgrading to the version 1.25.0 (from 1.24.0) i get the error in the title when getting TokenHolder.
My code looks the same as in your docs:
AuthAPI authAPI = new AuthAPI("{YOUR_DOMAIN}", "{YOUR_CLIENT_ID}", "{YOUR_CLIENT_SECRET}");
AuthRequest authRequest = authAPI.requestToken("https://{YOUR_DOMAIN}/api/v2/");
TokenHolder holder = authRequest.execute();
ManagementAPI mgmt = new ManagementAPI("{YOUR_DOMAIN}", holder.getAccessToken());
The problem is this line: TokenHolder holder = authRequest.execute();
In previous versions everything worked great but since update to 1.25.0 it throws the following error:
Caused by: java.lang.NoSuchMethodError: 'okhttp3.RequestBody okhttp3.RequestBody.create(byte[], okhttp3.MediaType)'
at com.auth0.net.CustomRequest.createRequestBody(CustomRequest.java:50)
at com.auth0.net.ExtendedBaseRequest.createRequest(ExtendedBaseRequest.java:49)
at com.auth0.net.BaseRequest.execute(BaseRequest.java:29)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:13
- Comments:29 (14 by maintainers)
Top Results From Across the Web
java - RequestBody.create(contentType, content) Deprecated
toMediaTypeOrNull() . For example how we need to create request body now since okhttp:4.1.0 import okhttp3.MediaType.Companion.
Read more >Ringout example throws exception java.lang ...
It seems that this error is related to function okhttp3.RequestBody okhttp3.RequestBody.create(java.lang.String, okhttp3.MediaType) , but I am ...
Read more >java.lang.NoSuchMethodError: okhttp3.RequestBody.create ...
http3 version that i use is 4.9.2(it in pom) java version - 8 binance-connector-java - 1.2 public String orderCreate(String currency, ...
Read more >Java - CSDN博客
RequestBody.create(Ljava/lang/String;Lokhttp3/MediaType;)Lokhttp3/RequestBody; 以上是某位大佬说的未解决我的问题说是web3j 版本的问题某个入口服务 ...
Read more >Developers - NoSuchMethodError: 'okhttp3.RequestBody ...
NoSuchMethodError : 'okhttp3.RequestBody okhttp3.RequestBody.create(java.lang.String, okhttp3.MediaType)'
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

It could be fixed by adding strictly version into the dependencies
Or adding the BOM into the dependencyManagement
Having the same issue… please fix asap!