-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[expo-file-system][android] Fix uploadAsync
signature and cast exception
#9076
[expo-file-system][android] Fix uploadAsync
signature and cast exception
#9076
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 Never slowing down with number of PRs opened per workday, eh? 😅
packages/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.java
Show resolved
Hide resolved
Will this PR be inside a patch release ? It's currently blocking the use of this new module for the whole version 38 ? Maybe it's already inside a patch, but can't find changelogs for 38.0.x versions ! |
I'm sorry for the late replay. Unofortynetly it wasn't published. I don't know if we will release a patch for |
Yep, already what I did when I seen this wrong signature, but having to handle one way on android and another way on iOS is a bit dirty, can't wait to use this :) Thanks for the reply, np man I know what is it to work on an open source project :) |
Hey @NeOMakinG could you please share how you used fetch to actually handle the file upload (In background) |
Hey @r-mhjn This is basically something like this : where
By the way, I don't do it on background yet, which means that if users put the app on background, the upload is aborted (and this is why uploadAsync is way more easy to use than setting up a background task with fetch) |
@NeOMakinG thanks alot mate, i think using this along with background fetch would do the job for me |
@NeOMakinG I also encountered this problem on Android, and then I used the fatch to send pictures to the backend according to your method. I want to save the image in the backend, I used the createwritestream in Node.js, but it has been unsuccessful. The size of the saved images is 0kb. Can you help me, please? Thank you very much! This is my code: |
@NeOMakinG Hi neo, where you able to set the api as a background task, as well so it does not abort when the app is back-grounded, i tried to do so but does'nt seem to be working, |
Never tried to do add it to a backgroundTask, as I seen that uploadAsync was coming and globally it seems that my users read the "Loading, don't quit the app" :/ Did you test on a standalone app ? I think backgroundTasks are not working on anything else than a standalone app! |
Oh damn, no i haven't tried it in a stand alone app, i create this app through normal expo init, |
https://docs.expo.io/versions/v38.0.0/sdk/task-manager/ It looks like background mode works on Expo for Android, but not on iOS, except on standalone apps |
I see the fix has been merged nearly a month ago i hope they publish it soon |
Yeah @NeOMakinG i got the code from the same documentation |
Unfortunately, I don't know at all :( Never faced it yet, but this looks designed to launch periodical tasks while the app is backgrounded, but not implicitly "launch a piece of code which will be executed even if the app is backgrounded", so maybe you can manage to do this with it.. |
Expo has been updated from 38.0.8 to 38.0.9 7 days ago, maybe the fix is inside this patch :) |
Just a second ill check my sdk version |
Yes exactly, i feel the same |
Im on sdk 38.0.0 damn , looks like time to upgrade |
I think it wasn't added to this patch :/ |
oh damn y so, its been a trouble for weeks, thanks for intimating @lukmccall, |
https://www.npmjs.com/package/expo Just looked there, didn't upgrade yet, but I think I upgraded to 38.0.8 some weeks ago |
Should i try something like expo upgrade@latest or version? |
I am still facing the same issue on Andorid (11) with SDK 42.0.1. I want to read the file using readAsStringAync but it throws
|
Same problem that @50shashwat I take the video from ImagePicker
|
Why
Fixes #9075
How
uploadAsync
signaturejava.lang.Double cannot be cast to java.lang.Integer
Test Plan