Skip to content

Failed transformation #153

@Tom-Horvat

Description

@Tom-Horvat

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

val transformation = Transformation<Transformation<*>>().width(1280)
        MediaManager.get().upload(uri)
            .option(TRANSFORMATION, transformation)
            .option(SIGNATURE, photoSignature.signature)
            .option(TIMESTAMP, photoSignature.timestamp)
            .option(PUBLIC_ID, photoSignature.publicId)
            .option(TAG, tag)
            .callback(object : UploadCallback {
                override fun onStart(requestId: String?) {
                    callback.onStart()
                }

                override fun onProgress(requestId: String?, bytes: Long, totalBytes: Long) {
                    callback.onProgress(bytes = bytes, totalBytes = totalBytes)
                }

                override fun onSuccess(requestId: String?, resultData: MutableMap<Any?, Any?>?) {
                    callback.onSuccess(resultData)
                }

                override fun onError(requestId: String?, error: ErrorInfo?) {
                    callback.onError(Throwable("CODE ${error?.code}: ${error?.description}"))
                }

                override fun onReschedule(requestId: String?, error: ErrorInfo?) {
                    callback.onError(Throwable("CODE ${error?.code}: ${error?.description}"))
                }
            })
            .dispatch()

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions