2

I am using file_picker: ^1.7.1 this plugin working fine in android, but getting exception while using in real device iOS 13.4.1, getting FileSystemException while uploading a pdf file.

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)

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

Md Shahnawaz
  • 556
  • 5
  • 20

1 Answers1

0

Seems like it there was an issue with the Flutter file_picker. Updating it should be a good fix.

Since iOS 13 you need to request access to files outside your app sandbox, via startAccessingSecurityScopedResource if not, you will see that length or open issue even though you do have a valid file path.

You can find more info in here which actually applies to files too.

Frank
  • 789
  • 4
  • 19