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
FileSystemException: Cannot retrieve length of file,(OS Error: No such file or directory, errno = 2) #261
Comments
@shahnawazahmed88 does that happen with all files or just that one? May I ask you to try with another one? Thanks. |
Yeah I tried with another pdf file "A Sample PDF.pdf", got exception [VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: FileSystemException: Cannot retrieve length of file, path = '/private/var/mobile/Containers/Data/Application/91C0B3B7-2102-49AE-9647-61904A9DB030/tmp/com.vassar.bluis-Inbox/A Sample PDF.pdf' (OS Error: No such file or directory, errno = 2) |
@shahnawazahmed88 that stack doesn't seem to be coming from the plugin itself but with something that you might be doing afterwards. May I ask you to post the code/lines where you got the exception? Thank you. |
I am not getting line number after this exception occurs, check here complete logs 2020-04-29 16:29:55.398581+0530 Runner[4401:1425062] [VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: FileSystemException: Cannot retrieve length of file, path = '/private/var/mobile/Containers/Data/Application/91C0B3B7-2102-49AE-9647-61904A9DB030/tmp/com.vassar.bluis-Inbox/A Sample PDF.pdf' (OS Error: No such file or directory, errno = 2) |
@shahnawazahmed88 can you post your code where you call the picker? It looks like you are creating a |
void onFileUploadIconClick(String datatype) async {
// print("XXXXXXXXXXXXXXXXXXXXXXXXXXX -- File name --" + filename);
// print("XXXXXXXXXXXXXXXXXXXXXXXXXXX -- New Name -- $newFileName");
} |
Add a statement after the switch case and if that prints, it’s nothing related to the picker but with something you’re doing afterwards. By looking at your first log, I can see that you have a valid file path, hence, it should be ok. Wrap all of that code with a |
@shahnawazahmed88 have you managed to solve it? |
@miguelpruivo here is my complete code, and its working pretty fine with Android devices
|
Does that happen with another file? |
No, I am using Video, and Photo all are working well, except document, but this is also working well in android device, only occurring issue in iOS 13.4 (I am using this one). |
Sure. But what if you pick a different document on iOS? Could you try it? Does that still happen? Are you on latest Xcode version? I can’t see anything wrong with the code itself, to me looks like it just can’t open a descriptor for that file (probably due to the name or any other particular reason). |
Any news on this? |
@miguelpruivo hey bro, everything is done from my side, just one thing I want to try, I want to run my code in lower version of the iOS device, currently I am using iOS 13.4, how it could be? might be this issue with some version-specific? |
I am facing same issue on ios |
@vanshg395 Hey bro, which iOS version currently you are using now? |
Ios 13.4, the problem is only occurring with pdf files and that too randomly, sometimes it works, sometimes it doesn’t. |
Its a sumilator or real device? |
Realdevice
…On Mon, 11 May 2020 at 11:03 AM, shahnawazahmed88 ***@***.***> wrote:
Its a sumilator or real device?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#261 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIKKCM22BKM7OAFKA6TYDILRQ6E3VANCNFSM4MTTKKXQ>
.
|
Exactly sometimes is working and sometimes it not, so except pdf file is it working for other documents fine? did you test with the lower version of the iOS device? |
No i only have one device with iOS 13.4, but this problem never occurred
before this instance.
…On Mon, 11 May 2020 at 11:06 AM, shahnawazahmed88 ***@***.***> wrote:
Exactly sometimes is working and sometimes it not, so except pdf file is
it working for other documents fine? did you test with the lower version of
the iOS device?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#261 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIKKCMZIT45WW6QDLORWR7DRQ6FF7ANCNFSM4MTTKKXQ>
.
|
For me the same code working nicely in android devices, Bro, let me know if you find any solution for it |
Does that happen to work randomly for the same file? Or different files? |
Same file gets choson sometimes, sometimes shows error.
…On Mon, 11 May 2020 at 2:26 PM, Miguel Ruivo ***@***.***> wrote:
Does that happen to work randomly for the same file? Or different files?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#261 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIKKCMYX3KRC5K2QAQ56HV3RQ64THANCNFSM4MTTKKXQ>
.
|
That’s odd as far as it concerns to picking files from the picker. It only gives you the path and that’s it. It didn’t even tries to open the file. Is it always a pdf? Does that happen with any other type? Could you tell me the name of the file so I can try to replicate it here? |
Thats the thing.
First of all it is happening only for pdf.
Second, it is returning the path but but then in console it prints cannot
access size for the given path and file not found.
…On Mon, 11 May 2020 at 3:20 PM, Miguel Ruivo ***@***.***> wrote:
That’s odd as far as it concerns to picking files from the picker. It only
gives you the path and that’s it. It didn’t even tries to open the file. Is
it always a pdf? Does that happen with any other type? Could you tell me
the name of the file so I can try to replicate it here?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#261 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIKKCM5VUXHHR4ZZ5EGJKVTRQ7C73ANCNFSM4MTTKKXQ>
.
|
@vanshg395 can you tell me exactly the name of the file that you are picking? So I can create a file with the same name to replicate it? It will be hard to fix if I cannot reproduce it. |
The file i used ‘Sample Agreement.pdf’. I picked it from icloud drive.
…On Mon, 11 May 2020 at 3:44 PM, Miguel Ruivo ***@***.***> wrote:
@vanshg395 <https://github.com/vanshg395> can you tell me exactly the
name of the file that you are picking? So I can create a file with the same
name to replicate it? It will be hard to fix if I cannot reproduce it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#261 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIKKCMYHLR5FQSK774UZ7J3RQ7FY5ANCNFSM4MTTKKXQ>
.
|
Have you managed to solve it @vanshg395? |
Closing due to inactivity. Feel free to reopen it if you still experience the same issue on latest versions (plugin and Flutter @ stable channel). Thank you. |
This problem occurs when I select the file and wait some time before making the request to send to the server, when sending capture this error. If I don't wait a while, the problem does not occur. Here my code:
On another screen, I just show the content and there is a button to send to the server. in the button method.
.. create a formData and send it to server. |
@bergtorresn iOS or Android? |
@miguelpruivo only iOS |
@bergtorresn yes this is working as expected. Files on iOS that are on |
Do you suggest creating this file locally and using it to upload to the server and delete it? |
@bergtorresn copying to your app’s temporary folder (cache). You don’t need to delete it explicitly afterwards. The system will purge whenever it needs it. |
@miguelpruivo i am trying to cache it the file but without success, how can i do it instead of using the tmp folder? (That is the pattern). |
Using the path provider plugin to get access to documents directory and then making a copy of the file into it or just moving it to there right after picking. |
For anyone looking for the code:
|
Hi, shall we delete the file after we proceed to upload the file to server using @b1acKr0se caching way? |
@walaoehh If you don't want to care about the file afterwards, you can consider using getTemporaryDirectory() instead of |
I am trying to post local phone asset but I am taking "FileSystemException (FileSystemException: Cannot retrieve length of file, path = 'cache/file_picker/IMG_20220428_115542.jpg' (OS Error: Permission denied, errno = 13))". This error. What is the main problem? |
👏 🎉 It'work for me |
guys can you check this answer its describing the issue and a good workaround for it |
Getting, Unhandled Exception: FileSystemException: Cannot retrieve length of file, path = '/private/var/mobile/Containers/Data/Application/0C1997E5-5243-494E-85EA-830E3248CC97/tmp/com.vassar.bluis-Inbox/https:%2Ffoodlicensing.fssai.gov.in%2FREG%2FRG_ViewReceipt.aspx?ReqID=68198366.pdf' (OS Error: No such file or directory, errno = 2)
in Android its working fine but in iOS 13.4 real device getting above exception
Issue details
Working fine in android, select any pdf file and try to upload to server in iOS real device 13.4
Error Log
2020-04-29 15:56:04.991427+0530 Runner[4358:1416983] [VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: FileSystemException: Cannot retrieve length of file, path = '/private/var/mobile/Containers/Data/Application/0C1997E5-5243-494E-85EA-830E3248CC97/tmp/com.vassar.bluis-Inbox/https:%2Ffoodlicensing.fssai.gov.in%2FREG%2FRG_ViewReceipt.aspx?ReqID=68198366.pdf' (OS Error: No such file or directory, errno = 2)
#0 _File.length. (dart:io/file_impl.dart:376:9)
#1 _rootRunUnary (dart:async/zone.dart:1134:38)
#2 _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#3 _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#4 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
#5 Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#6 Future._completeWithValue (dart:async/future_impl.dart:524:5)
#7 Future._asyncComplete. (dart:async/future_impl.dart:554:7)
#8 _rootRun (dart:async/zone.dart:1126:13)
#9 _CustomZone.run (dart:async/zone.dart:1023:19)
#10 _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#11 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:965:23)
#12 _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
#13 _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
Flutter Version details
[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.15.4 19E287,
locale en-IN)
• Flutter version 1.12.13+hotfix.9 at /Users/teja/flutter_dev/flutter
• Framework revision f139b11009 (4 weeks ago), 2020-03-30 13:57:30 -0700
• Engine revision af51afceb8
• Dart version 2.7.2
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/teja/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling
support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.4.1, Build version 11E503a
• CocoaPods version 1.9.1
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)
[✓] Connected device (1 available)
• Shahnawaz’s iphone • d59a055eb9bbddc9be958142d9c484e3c45bbf2f • ios • iOS
13.4.1
• No issues found!
The text was updated successfully, but these errors were encountered: