New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start upload files display TransactionTooLargeException #554
Comments
Please can you post the code which generates this request? |
I couldn't give you the request because It's a live crash on firebase. I checked the steps and I found that this happened when the user want to upload large files data, so does this question related to this issue |
But you have written the code which triggers that exception. The library has not any problem sending big files (recently I made a test with 2.2 GB file: #517 (comment)), so check how you are constructing the upload request. Bear in mind request parameters should not have big strings as values. TransactionTooLargeException is due to the Android Parcel size limitation. |
I checked it, but the file is small size not a big one. fun Context.startNewUpload(taskClass: Class, params: UploadTaskParameters): String {
} Android version 10 |
Please I don't handle this exception. This exception inside the lib in the code above "startForegroundService(intent)" |
@EngKhAboshama of course, because that's the point where the request gets validated, but the problem resides surely in how you are building the |
@gotev My code is So, what is the problem of my code? |
Check
so it means the total size of the parameters exceeds the maximum allowed by the system. In this case the file size does not count as files are referenced only by path when building the request. |
Please also post Upload Service version used and please follow the issue template given next time, thanks 😉 |
@gotev Thank you very much. I found that the icon of the notification bitmap is a large one. I have to use the options parameter in the BitmapFactory.decodeResource() to decrease the size of the bitmap. Sure, I will use it 👍 |
@gotev Please If I want to pass a bitmap with the lib, so can you provide me steps to do this? |
Save it to a temp file and then use its path |
I'm using UploadNotificationStatusConfig class which inside the package package "net.gotev.uploadservice.data", so I have to customize the "NotificationHandler" class to use this way, isn't it? |
I thought |
Sorry for my last comment. If you check the following function Thank you in advance. |
Ok, so in that case the only advice I can give is to shrink your original icon resource using photoshop or similar program. It's not good to have such big assets in your app. Closing this as it's not a library bug. |
Please can you give me information about how can I upload large files?
Caused by java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 10516560 bytes
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1692)
at android.app.ContextImpl.startForegroundService(ContextImpl.java:1638)
at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:688)
at net.gotev.uploadservice.extensions.ContextExtensionsKt.startNewUpload(ContextExtensions.kt:31)
at net.gotev.uploadservice.UploadRequest.startUpload(UploadRequest.kt:54)
at net.gotev.uploadservice.observer.request.RequestObserver.subscribe(RequestObserver.kt:52)
at net.gotev.uploadservice.UploadRequest.subscribe(UploadRequest.kt:82)
The text was updated successfully, but these errors were encountered: