miguelpruivo / flutter_file_picker

File picker plugin for Flutter, compatible with mobile (iOS & Android), Web, Desktop (Mac, Linux, Windows) platforms with Flutter Go support.
MIT License
1.33k stars 665 forks source link

If folder picker is canceled on Windows, the app closes #1297

Closed feinstein closed 1 year ago

feinstein commented 1 year ago

If I open a folder picker, using the exact same code as the one in the README, and I close the picker, without selecting anything, on Windows 10, my app closes, but there are not exceptions.

Also, when the picker opens, the UI locks, so a ripple in a button stays there locked in place, as if the animation was paused, maybe those 2 are related?

This is in Windows 10 and Fluter 3.10.2.

The file picker works fine, I can only see this behavior on the folder picker.

DanielusG commented 1 year ago

I can confirm that this happens to me as well.

On flutter 3.10.1 Windows 11 Dart 3.0.1

With the latest version of the library (5.3.2)

The closing of my program occurs even if I select the folder, and pass it to a TextFieldEditingController, the application closes without showing any error

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 14 days with no activity.

feinstein commented 1 year ago

What happens on stale issues?

PlugFox commented 1 year ago

The same problem here

Windows 11

$ fvm flutter --version

Flutter 3.12.0 • channel beta • https://github.com/flutter/flutter.git
Framework • revision 8fcb74dbc1 (4 days ago) • 2023-06-08 13:37:31 -0600
Engine • revision b84ad1ad30
Tools • Dart 3.1.0 (build 3.1.0-163.1.beta) • DevTools 2.24.0

Just got:

Lost connection to device.

Exited.

Problem with latest version 5.3.2 5.3.1 - works fine

hhandika commented 1 year ago

I have the same issue using Flutter stable channel. Current, work around is to limit using 5.3.1.

Flutter 3.10.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 796c8ef792 (2 days ago) • 2023-06-13 15:51:02 -0700
Engine • revision 45f6e00911
Tools • Dart 3.0.5 • DevTools 2.23.1
czw299 commented 1 year ago

same

guchengxi1994 commented 1 year ago

Is this issue related to win32? I found 5.3.1 can use win32 4.1.4, but 5.3.2 can only use win32 5.0.3 above.

feinstein commented 1 year ago

Last time I checked this lib used ffi, so maybe using the win32 package could solve this issue and even make easier to maintain the lib.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 14 days with no activity.

feinstein commented 1 year ago

Please don't close it.

Xmarmalade commented 1 year ago

I had a similar problem, but with an older version: file_picker: ^5.2.11. According to my tests, my project has this problem since v0.1.1. But the previous version, 0.1.0, did not have these problems. And between these two versions, I did not upgrade file_picker's dependency.

The files are built automatically by GitHub Actions, using the flutter master channel

running flutter doctor -v:

[√] Flutter (Channel master, 3.12.0-11.0.pre.52, on Microsoft Windows
    • Flutter version 3.12.0-11.0.pre.52 on channel master at C:\%AppData%\Local\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 43bda355b0 (3 hours ago), 2023-06-28 05:17:25 -0400
    • Engine revision 17173994a8
    • Dart version 3.1.0 (build 3.1.0-255.0.dev)
    • DevTools version 2.24.0

Is there a flutter/dart related possibility? I found a similar issue in flutter's issue list: https://github.com/flutter/flutter/issues/129005

V3ntus commented 1 year ago

This still happens for both cancellation and successful pick.

file_picker: 5.3.2
win32: 5.0.5
ffi: 2.0.2

Flutter (Channel stable, 3.10.5, on Microsoft Windows [Version 10.0.19045.3086], locale en-US)
    • Flutter version 3.10.5 on channel stable at C:\Users\...\development\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (2 weeks ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1
V3ntus commented 1 year ago

Crashes without error. What's the best way to debug low level bugs like this?

cherking19 commented 1 year ago

Having this problem as well in the latest 5.3.2 version. I downgraded to 5.3.1 and this is the latest version it seems where it works. I don't know what the new version adds and this is good enough for me.

Xmarmalade commented 1 year ago

Crashes without error. What's the best way to debug low level bugs like this?

As suggested in https://github.com/flutter/flutter/issues/129005, the Visual Studio Debugger should be used https://learn.microsoft.com/en-us/visualstudio/debugger/attach-to-running-processes-with-the-visual-studio-debugger

V3ntus commented 1 year ago

@Xmarmalade is there anything special about VSCode debugger compared to Android Studio's or the native Dart profile/debug view?

Xmarmalade commented 1 year ago

@Xmarmalade is there anything special about VSCode debugger compared to Android Studio's or the native Dart profile/debug view?

Not VSCode debugger but Visual Studio Debugger

The application is crashing; there are innumerable ways that could be happening. You'd need to run it under the Visual Studio debugger to get more details for anyone to be able to speculate on the cause.

V3ntus commented 1 year ago

Ahh my mistake. Just woke up lol. Yes I do see how this debugger would make a difference, I'll try this. Thank you

stardocs-services commented 1 year ago

Crashed even on 5.2.7. No exceptions caught also.

V3ntus commented 1 year ago

I've found a better alternative is to use the first party plugin from flutter file_selector https://pub.dev/packages/file_selector

As this is a first party plugin from flutter, it is maintained and updated more frequently.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 14 days with no activity.

feinstein commented 1 year ago

Keep it open

PlugFox commented 1 year ago

Crashed even on 5.2.7. No exceptions caught also.

@stardocs-services Try to lower win32 package version. And do not use ^ symbol at pubspec.yaml for this dependencies.

From my pubspec.lock :

flutter: 3.10.5 (use it through fvm)
win32: 4.1.4
file_picker: 5.3.1

works fine for me.

Northn commented 1 year ago

Same here, it's still bugged image

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 14 days with no activity.

feinstein commented 1 year ago

Keep it open. @miguelpruivo what's the point of this bot? Does it close stale issues?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 14 days with no activity.

feinstein commented 1 year ago

Keep open

bacardeveloper commented 1 year ago

In my project i go back version : 5.3.1 it's work for me.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 14 days with no activity.

tbm98 commented 1 year ago

I have same issue: app close after pick folder without console log (both choose cancel or select). both on 5.3.3 and 5.3.2. 5.3.1 work ok.

flutter: beta: 3.13.0-0.3.pre windows: 10 pro

krll-kov commented 1 year ago

e same issue: app

You can temporary use my fork with this issue gotten fixed: https://github.com/miguelpruivo/flutter_file_picker/pull/1340

like this:

  file_picker:
    git:
      url: https://github.com/kirill-21/flutter_file_picker
      ref: master

Note that i'll remove cloned repository from my profile as soon as this fix is merged into this repo

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 14 days with no activity.

feinstein commented 1 year ago

Don't close

Minghime commented 1 year ago

@feinstein It seems that this PR #1356 found the cause of the Crash. Before the author solves this problem, I personally recommend temporarily using the official library file_selector.

file_selector: ^1.0.0

BTW:

What happens on stale issues?

Refer Github Docs Closing inactive issues.

And

The workflow file maintainer.yml of this repo.

The issues will be marked as stale after 7 days of inactivity, and the issues will be closed after being marked as stale and after 14 days of inactivity.

miguelpruivo commented 1 year ago

Waiting for the PR owner to apply the required changes and then I'll merge it.

krll-kov commented 1 year ago

Waiting for the PR owner to apply the required changes and then I'll merge it.

Hi, I've added a pull request to fix this issue 3 weeks ago: https://github.com/miguelpruivo/flutter_file_picker/pull/1340

The one you've mentioned above fixes it wrongly by removing extra .release call which leads to a memory leak

feinstein commented 1 year ago

@Minghimea thanks for the clarifications.

krll-kov commented 1 year ago

@Minghimea thanks for the clarifications.

It should be already fixed image

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.