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

file_picker: ^8.1.6 ,FilePickerResult always return null,but 8.1.4 is ok #1652

Open
superluo opened this issue Dec 19, 2024 · 6 comments
Open
Labels
new issue An issue that hasn't yet been seen from the maintainer stale

Comments

@superluo
Copy link

problem: FilePickerResult always return null
code:FilePickerResult? result = await FilePicker.platform.pickFiles( allowMultiple: true );
version:file_picker: ^8.1.6

console log :[ ] I/FilePickerDelegate(24128): User cancelled the picker request

but
file_picker: 8.1.4 is ok

env:
flutter doctor -v
[✓] Flutter (Channel stable, 3.27.1, on macOS 15.2 24C101 darwin-arm64, locale en-US)
• Flutter version 3.27.1 on channel stable at /Users/abc/install/dev/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 17025dd882 (2 days ago), 2024-12-17 03:23:09 +0900
• Engine revision cb4b5fff73
• Dart version 3.6.0
• DevTools version 2.40.2

@superluo superluo added the new issue An issue that hasn't yet been seen from the maintainer label Dec 19, 2024
@abdelaziz-mahdy
Copy link
Contributor

looking at the difference in code it looks like a permission error, i am not sure but it may lead you to a fix 4083ae4

since the checks for permission got removed

@superluo
Copy link
Author

according:4083ae4

[android]
problem:file_picker: ^8.1.6
1.only support video and images ,others return null
demo code:
`
PermissionStatus status = await Permission.photos.request();
LogE("PermissionStatus.photos:${status.isGranted}"); // true
status = await Permission.videos.request();
LogE("PermissionStatus.videos:${status.isGranted}"); // true
status = await Permission.audio.request();
LogE("PermissionStatus.audio:${status.isGranted}"); // true
status = await Permission.manageExternalStorage.request();
LogE("PermissionStatus.manageExternalStorage:${status.isGranted}"); // true

FilePickerResult? result = await FilePicker.platform.pickFiles(
  allowCompression: false,
  allowMultiple: true,
  type: FileType.video,//  FileType.image, FileType.audio
);

2.[allowedExtensions] 2.1.works well code:
type: FileType.custom,
allowedExtensions: ['jpg', 'png', 'mp4', 'mov'],
2.2.return null
type: FileType.custom,// FileType.any
allowedExtensions: ['pdf','docx'],
`
2.3.console log:return null
[ ] I/FilePickerDelegate(20648): User cancelled the picker request

3.file_picker: ^8.1.4

always works well

Copy link

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

@github-actions github-actions bot added the stale label Jan 22, 2025
@Matej-Hlatky
Copy link

Same issue also with version 8.3.1.

Downgrade to version 8.1.4 "solves" the issue.

@akaiser
Copy link

akaiser commented Feb 1, 2025

related #1404

Copy link

github-actions bot commented Mar 4, 2025

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

@github-actions github-actions bot added the stale label Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new issue An issue that hasn't yet been seen from the maintainer stale
Projects
None yet
Development

No branches or pull requests

4 participants