question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong saveDir value on iOS

See original GitHub issue

On iOS if the path doesn’t end with /, flutter_downloader adds /(null) and fails the download.

Steps to reproduce:

  1. Directory directory = await getApplicationDocumentsDirectory();
  2. directory.path will be something like “/SOME/PATH/Documents
  3. await FlutterDownloader.enqueue(..., saveDir: directory.path);
  4. final tasks = await FlutterDownloader.loadTasks();
  5. checking last task in tasks, its saveDir value will be “/SOME/PATH/Documents/(null)

flutter_downloader version: 1.2.2

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
guangyingmodaocommented, Oct 11, 2019

On iOS if the path doesn’t end with /, flutter_downloader adds /(null) and fails the download.

Steps to reproduce:

  1. Directory directory = await getApplicationDocumentsDirectory();
  2. directory.path will be something like “/SOME/PATH/Documents
  3. await FlutterDownloader.enqueue(..., saveDir: directory.path);
  4. final tasks = await FlutterDownloader.loadTasks();
  5. checking last task in tasks, its saveDir value will be “/SOME/PATH/Documents/(null)

flutter_downloader version: 1.2.2

maybe you should check the first task in tasks.

0reactions
harkairtcommented, Jan 26, 2021

flutter_downloader: ^1.5.2 I can still reproduce this on ios simulator when using getApplicationDocumentsDirectory(). If I rather save into a subfolder inside the documents, then its okay, also as @jimmycasey wrote when simply appending a Platform.pathSeparator at the end of documents folder, it also works

✖️ getApplicationDocumentsDirectory(): /Users/<username>/Library/Developer/CoreSimulator/Devices/2833D949-3B27-47CB-9377-AAF6EC9E5F26/data/Containers/Data/Application/716965B2-D072-40BB-8EA0-32F6EA1C97BB/Documents/(null)

✔️ getApplicationDocumentsDirectory() + Platform.pathSeparator /Users/<username>/Library/Developer/CoreSimulator/Devices/2833D949-3B27-47CB-9377-AAF6EC9E5F26/data/Containers/Data/Application/716965B2-D072-40BB-8EA0-32F6EA1C97BB/Documents

✔️ getApplicationDocumentsDirectory() + Platform.pathSeparator + 'DL' /Users/<username>/Library/Developer/CoreSimulator/Devices/2833D949-3B27-47CB-9377-AAF6EC9E5F26/data/Containers/Data/Application/716965B2-D072-40BB-8EA0-32F6EA1C97BB/Documents/DL

Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS update and restore errors - Apple Support
Learn how to solve iOS update and restore errors. ... [error number]," use these steps. If you still see the error, try the...
Read more >
Configuration Variables — Ren'Py Documentation
To locate the save directory, read config.savedir instead of this variable. ... The default value is False, which means that menu only the...
Read more >
Troubleshooting iOS/iPadOS device enrollment errors in ...
The following table lists errors that end users might see while enrolling iOS/iPadOS devices in Intune. Error message, Issue, Resolution ...
Read more >
MacRumors: Apple News and Rumors
As of writing, only Amazon is offering the M2 iPad Pro at this low of a price. The Apple Pencil 2 is available...
Read more >
Screen Time Wrong? Showing Inaccurate Usage on iPhone ...
Many iPhone and iPad users have discovered Screen Time is reporting incorrect time estimates for apps and webpages, sometimes showing ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found