You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get an java.lang.ClassCastException: com.cloudinary.Transformation cannot be cast to java.lang.String error when attempting a transformation: val transformation = Transformation<Transformation<*>>().width(1280).crop("scale")
Issue Type (Can be multiple)
[ ] Build - Can’t install or import the SDK
[ ] Performance - Performance issues
[x] Behaviour - Functions aren’t working as expected (Such as generate URL)
[x] Documentation - Inconsistency between the docs and behaviour
[ ] Other (Specify)
java.lang.ClassCastException: com.cloudinary.Transformation cannot be cast to java.lang.String at com.cloudinary.Util.buildUploadParams(Util.java:63) at com.cloudinary.Uploader.buildUploadParams(Uploader.java:51) at com.cloudinary.Uploader.uploadLargeParts(Uploader.java:160) at com.cloudinary.Uploader.uploadLarge(Uploader.java:149) at com.cloudinary.android.DefaultRequestProcessor.doProcess(DefaultRequestProcessor.java:223) at com.cloudinary.android.DefaultRequestProcessor.processRequest(DefaultRequestProcessor.java:87) at com.cloudinary.android.MediaManager.processRequest(MediaManager.java:441) at com.cloudinary.android.AndroidJobStrategy$UploadJob.doWork(AndroidJobStrategy.java:163) at androidx.work.Worker$1.run(Worker.java:86) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012)
Build System
[ ] Maven
[x] Gradle
[ ] Other (Specify)
Is the issue reproducible only on a specific device?
[x] No
[ ] Yes (specify model + Android version + vendor build number, if applicable)
Versions and Libraries (fill in the version numbers)
Cloudinary Android SDK version 2.3.1
Android version - 33
Kotlin version - 1.8.10
JVM (of the dev environment) - 17
Gradle - 8.0
The text was updated successfully, but these errors were encountered:
Hi there @TomislavHorvat1, the error you're encountering indicates that there is a type mismatch when passing the Transformation object as an option in the Cloudinary upload request.
To resolve this issue, you can try the following steps:
Check that you have imported the correct Transformation class from the Cloudinary SDK. It should be com.cloudinary.Transformation.
Modify the val transformation declaration to remove the generic type parameter. Simply use val transformation = Transformation().
When setting the TRANSFORMATION option in the upload request, convert the transformation object to a string using the toString() method. Update the option line as follows:
Describe the bug in a sentence or two.
I get an
java.lang.ClassCastException: com.cloudinary.Transformation cannot be cast to java.lang.String
error when attempting a transformation:val transformation = Transformation<Transformation<*>>().width(1280).crop("scale")
Issue Type (Can be multiple)
[ ] Build - Can’t install or import the SDK
[ ] Performance - Performance issues
[x] Behaviour - Functions aren’t working as expected (Such as generate URL)
[x] Documentation - Inconsistency between the docs and behaviour
[ ] Other (Specify)
Steps to reproduce
Error screenshots or Stack Trace (if applicable)
java.lang.ClassCastException: com.cloudinary.Transformation cannot be cast to java.lang.String at com.cloudinary.Util.buildUploadParams(Util.java:63) at com.cloudinary.Uploader.buildUploadParams(Uploader.java:51) at com.cloudinary.Uploader.uploadLargeParts(Uploader.java:160) at com.cloudinary.Uploader.uploadLarge(Uploader.java:149) at com.cloudinary.android.DefaultRequestProcessor.doProcess(DefaultRequestProcessor.java:223) at com.cloudinary.android.DefaultRequestProcessor.processRequest(DefaultRequestProcessor.java:87) at com.cloudinary.android.MediaManager.processRequest(MediaManager.java:441) at com.cloudinary.android.AndroidJobStrategy$UploadJob.doWork(AndroidJobStrategy.java:163) at androidx.work.Worker$1.run(Worker.java:86) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012)
Build System
[ ] Maven
[x] Gradle
[ ] Other (Specify)
Is the issue reproducible only on a specific device?
[x] No
[ ] Yes (specify model + Android version + vendor build number, if applicable)
Versions and Libraries (fill in the version numbers)
Cloudinary Android SDK version 2.3.1
Android version - 33
Kotlin version - 1.8.10
JVM (of the dev environment) - 17
Gradle - 8.0
The text was updated successfully, but these errors were encountered: