my code is below.I try to upload image into cloudinary through java but not uploaded it shows the below error
Exception in thread "main" java.lang.UnknownError: Can't find Cloudinary platform adapter [com.cloudinary.android.UploaderStrategy,com.cloudinary.http42.UploaderStrategy,com.cloudinary.http43.UploaderStrategy] at com.cloudinary.Cloudinary.loadStrategies(Cloudinary.java:76) at com.cloudinary.Cloudinary.(Cloudinary.java:91) at ImageUpload.main(ImageUpload.java:16)
my code is following
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import com.cloudinary.Cloudinary;
import com.cloudinary.utils.ObjectUtils;
public class ImageUpload {
public static void main(String arg[])throws Exception{
Map config = ObjectUtils.asMap(
"cloud_name", "dq8rshzka",
"api_key", "484362882976754",
"api_secret", "1zwPe6-VfVjj3rueX6zSsfyNyro");
Cloudinary cloudinary = new Cloudinary(config);
Map result = cloudinary.api().resource("sample", ObjectUtils.emptyMap());
}
}
Please open a support ticket and Cloudinary's support team will be happy to assist. Regardless, please note that your account's api_secret
should never be revealed. You should go to your account's settings page and generate a new pair of api key and secret.
Try add this to your proguard rules file:
-keep class com.cloudinary.** { *; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With