dio icon indicating copy to clipboard operation
dio copied to clipboard

FileSystemException: Cannot delete file

Open pro100svitlo opened this issue 2 years ago • 1 comments

New Issue Checklist

  • [x] I have searched for a similar issue in the project and found none

Issue Info

Info Value
Platform Name e.g. flutter / ios / android flutter
Platform Version e.g. 1.5.0 / 12.0 / 9.0 2.10.0
Dio Version e.g. 2.1.0 / 1.0.17 4.0.4

Issue Description and Steps

In the Crashlytics I see next exception:

Exception: io.flutter.plugins.firebase.crashlytics.FlutterError
Exception: Unexpected api error happened: FileSystemException: Cannot delete file, path = '/data/user/0/my.app.package/app_flutter/audio/91/0.mp3' (OS Error: No such file or directory, errno = 2). Error thrown null.

._rootRunUnary (.java)
DioForNative.download._closeAndDelete (dio_for_native.dart:158)
DioForNative.download.<fn> (dio_for_native.dart:225) 

I am using download method for mp3 files:

_dio.download(
      'url here',
      'file path here',
    );

Any ideas why this can happen or how to fix it?

pro100svitlo avatar Apr 03 '22 09:04 pro100svitlo

@wendux any help on this would be highly appreciated 🙏

pro100svitlo avatar Apr 04 '22 10:04 pro100svitlo

reported the same thing on Sentry

dr0-dev avatar Oct 19 '22 14:10 dr0-dev

I believe this has already been solved by #1393?

AlexV525 avatar Dec 15 '22 03:12 AlexV525