Open Hadit1993 opened 1 year ago
Problem is the required dependency com.squareup.okhttp3:okhttp:3.10.0
(from 2018)
You are probably using a newer okhttp version in your project through spring.
Still not fixed ?? 7 months
problem still......however, as 0x00117 say, i add the okhttp dependency, now it work well.
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.10.0</version>
</dependency>
ImageKit imageKit = ImageKit.getInstance();
Configuration config = new Configuration(your_public_key, your_private_key, your_url_endpoint);
imageKit.setConfig(config);
byte[] bytes1 = file.getBytes();
FileCreateRequest fileCreateRequest = new FileCreateRequest(
bytes1, // required, "binary", "base64" or "file url"
"sample-image11.jpg" // required
);
Result resultt = imageKit.upload(fileCreateRequest);
System.out.println(resultt);
@NoonieBao I recommend you not using this library in real projects. it's obvious that this repository is not maintained properly and in the future you may get dependency version conflict errors.
@NoonieBao I recommend you not using this library in real projects. it's obvious that this repository is not maintained properly and in the future you may get dependency version conflict errors.
Good tips, thanks! It is only being used for my personal project, and I have made a backup for unexpected conflicts.
Hi. I went along with documentaion and added config.properties in my resource folder and added public and private keys and url endpont there. and here is my imagekit instantiation:
When I run the app I got this error:
What is the problem?