miguelpruivo/flutter_file_picker

We are using Android activity launch mode as singleInstance. Few of the devices file selection not returning values.Its giving null. We can't change the launch mode as well becuase other features may break.Please check this critical bug.Lots of users are reporting this

Closed this issue · 7 comments

Before creating an issue, make sure that you are on the latest file_picker version and that there aren't already any similar opened inssues. Also, check if it isn't described on the Wiki, specially on Troubleshooting page.

Also, sometimes a simple flutter clean and flutter build again with latest file_picker version, may end up by fixing cached issues, so I encourage you to first do so.

Describe the bug
We are using android activity launch mode as singleInstance. Few of the devices file selection not returning values.Its giving null. We can't change the launch mode as well becuase other features may break.Please check this critical bug.Lots of users are reporting this

Platform

  • Android
  • iOS
  • Web
  • Desktop

Platform OS version
What version did it happen? 6.1.1

How are you picking?

`    FilePickerResult? result = await FilePicker.platform.pickFiles(allowedExtensions: ['jpg','jpeg','png','pdf'],type: FileType.custom);
`

Details to reproduce the issue
Android manifest set launch mode as singleInstance and try to get file

Error Log
Please, post the full console log of your issue, if applicable.

Screenshots and/or video
If applicable, add screenshots or video to help explain your problem.

Flutter Version details
Please, post the output of your flutter doctor -v, preferably, while running the issued device/simulator.

Additional context
Add any other context about the problem here.

Anybody else facing this issue?

Yes, of course! I have same problem with file picking from android file manager. I install pub file_picker: ^6.1.1 and try
FilePicker.platform.pickFiles(allowMultiple: true).then((value) =>
value != null
? _onFilesRecieve(value.files.map((e) => File(e.path!)).toList())
: null);
and on Android 14 (and some Android 13 shells), the result of the value always is "null"
I have set the values for compileSdkVersion 34 and targetSdkVersion 34 and it didn't have any effect.

Here is my flutter doctor -v results:

[√] Flutter (Channel stable, 3.16.2, on Microsoft Windows [Version 10.0.19043.928], locale ru-RU)
• Flutter version 3.16.2 on channel stable at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 9e1c857886 (4 days ago), 2023-11-30 11:51:18 -0600
• Engine revision cf7a9d0800
• Dart version 3.2.2
• DevTools version 2.28.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc3)
• Android SDK at C:\Users\USER\AppData\Local\Android\sdk
• Platform android-34, build-tools 34.0.0-rc3
• Java binary at: D:\Programs\Android\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.5.2)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.5.33502.453
• Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2022.2)
• Android Studio at D:\Programs\Android
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)

[√] VS Code (version 1.76.2)
• VS Code at C:\Users\USER\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.78.0

[√] Connected device (4 available)
• SM S918B (mobile) • MY_ID • android-arm64 • Android 14 (API 34)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19043.928]
• Chrome (web) • chrome • web-javascript • Google Chrome 119.0.6045.161
• Edge (web) • edge • web-javascript • Microsoft Edge 119.0.2151.93

[√] Network resources
• All expected network resources are available.

• No issues found!

No one file type isn`t returned based on the selection results.
Similarly, this bug reproduced with pub version file_picker: ^5.3.0 with Flutter 3.7.7

MOST UPDATE: this guy found the way to fix it #1404 (comment)

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

I am also facing the same issue

Change the activity launchMode to singelTask

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

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