Failed transformation
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- mobile-dev
Research direction
Start at Util.java:63, where the stack trace shows the transformation upload parameters are built, then follow Uploader.java:51 and the MediaManager upload path. Reproduce the Kotlin example with Cloudinary Android SDK 2.3.1 and verify that a transformation upload no longer raises ClassCastException and behaves consistently with the documentation.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Java
- Stars
- 69
- Forks
- 60
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudinary/cloudinary_android
-
ANR triggered by slow operations in main threadMay be free again @adimiz1 claimed this 690 days ago, and no pull request is open. Open
cloudinary/cloudinary_android#181 · 1 assignee ·
-
want to add minimal sample projectMay be free again @adimiz1 claimed this 703 days ago, and no pull request is open. Open
cloudinary/cloudinary_android#180 · 1 comment · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
cloudinary/cloudinary_android#173 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
cloudinary/cloudinary_android#169 · 3 comments ·
-
java.lang.RuntimeException: General Error on signed upload with chunk_size optionMay be free again @tommyg-cld claimed this 1285 days ago, and no pull request is open. Open
cloudinary/cloudinary_android#148 · 26 comments · 1 assignee ·
All issues in cloudinary/cloudinary_android
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Backblaze/b2-sdk-java#248 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
IETF-Hackathon/pqc-certificates#351 ·
Maintainers usually reply within 2 days
-
hermes-queue
Difficulty 2/5 Under an hour Newbie friendliness 72/100
chrisalunlloyd2-sudo/mindpalace#393 ·
Maintainers usually reply within 1 day