Skip to content
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

Crashing on incomplete saveFile() #1523

Open
1 of 4 tasks
timoxd7 opened this issue Jun 4, 2024 · 4 comments
Open
1 of 4 tasks

Crashing on incomplete saveFile() #1523

timoxd7 opened this issue Jun 4, 2024 · 4 comments
Labels
bug Something isn't working feature-candidate This issue might result in a feature to be implemented

Comments

@timoxd7
Copy link

timoxd7 commented Jun 4, 2024

Describe the bug
Invoking saveFile() without filename or without bytes parameter will crash the app silently.

Platform

  • Android
  • iOS
  • Web
  • Desktop

Platform OS version
17.5

How are you picking?

// Working:
outputFile = await FilePicker.platform.saveFile(
  dialogTitle: 'Please select an output file:',
  fileName: 'file.txt',
  type: FileType.any,
  bytes: Uint8List(0),
);

// Not working:
outputFile = await FilePicker.platform.saveFile(
  dialogTitle: 'Please select an output file:',
  fileName: 'log.txt',
  type: FileType.any,
);

outputFile = await FilePicker.platform.saveFile(
  dialogTitle: 'Please select an output file:',
  type: FileType.any,
  bytes: Uint8List(0),
);

Details to reproduce the issue
Use code provided above

Error Log
None, will crash at FilePickerPlugin.m:181 if no file name is provided for example.

Flutter Version details
[✓] Flutter (Channel stable, 3.22.1, on macOS 14.5 23F79 darwin-arm64, locale de-DE)
• Flutter version 3.22.1 on channel stable at /Users/timo/sdk/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision a14f74ff3a (13 days ago), 2024-05-22 11:08:21 -0500
• Engine revision 55eae6864b
• Dart version 3.4.1
• DevTools version 2.34.3

Additional context
file_picker version 8.0.3

@timoxd7 timoxd7 added the new issue An issue that hasn't yet been seen from the maintainer label Jun 4, 2024
@navaronbracke navaronbracke added bug Something isn't working feature-candidate This issue might result in a feature to be implemented and removed new issue An issue that hasn't yet been seen from the maintainer labels Jun 10, 2024
@sotowang
Copy link

sotowang commented Aug 7, 2024

i got the same issue on android

@xiaoqiaowoai
Copy link

I got the same problem on an ios iPad.

@vargab95
Copy link

vargab95 commented Nov 2, 2024

I got the same on android. Using the "bytes: Uint8List(0)," workaround now.

@alexaungmyooo
Copy link

Where do you guys save the file on iOS. I can't save any where because does not have the necessary permissions. I can't save the file on iCloud and Google drive as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature-candidate This issue might result in a feature to be implemented
Projects
None yet
Development

No branches or pull requests

6 participants