Repository navigation
[image_picker] After selection image from gallery in android 16, receiving file object as null #182071
Copy link
Copy link
Closed
flutter/packages
#11320Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listp: image_pickerThe Image Picker plugin.The Image Picker plugin.packageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyAndroid applications specificallyteam-androidOwned by Android platform teamOwned by Android platform team
Description
Steps to reproduce
Selecting image from gallery in android 16 is not considered.
Expected results
should work as expected in other versions
Actual results
After selection image from gallery in android 16, receiving file object as null
Code sample
Code sample
1. ImagePicker _imagePicker = ImagePicker();
2. final XFile? file = await _imagePicker.pickImage(
source: imageSource, maxHeight: 1000, maxWidth: 1000);
File pFile = File(file!.path);
3. After selecting an image In android 16 we are receiving file as null.
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.35.1, on macOS 15.6.1 24G90 darwin-arm64, locale en-QA) [2.0s]
• Flutter version 3.35.1 on channel stable at /Users/mymacbook04/flutter
• Upstream repository [https://github.com/flutter/flutter.git
•](https://github.com/flutter/flutter.git%E2%80%A8%E2%80%A2) Framework revision [20f8274](https://github.com/flutter/flutter/commit/20f82749394e68bcfbbeee96bad384abaae09c13) (6 months ago), 2025-08-14 10:53:09 -0700
• Engine revision [1e9a811](https://github.com/flutter/flutter/commit/1e9a811bf8e70466596bcf0ea3a8b5adb5f17f7f)
• Dart version 3.9.0
• DevTools version 2.48.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-lldb-debugging
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [6.7s]
• Android SDK at /Users/mymacbook04/Library/Android/sdk
• Emulator version 36.2.12.0 (build_id 14214601) (CL:N/A)
• Platform android-36.1, build-tools 36.1.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: flutter config --jdk-dir="path/to/jdk".
• Java version OpenJDK Runtime Environment (build 21.0.7+-13880790-b1038.58)
• All Android licenses accepted.
[!] Xcode - develop for iOS and macOS (Xcode 16.2) [4.6s]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16C5032a
! CocoaPods 1.14.3 out of date (1.16.2 is recommended).
CocoaPods is a package manager for iOS or macOS platform code.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see [https://flutter.dev/to/platform-plugins
To](https://flutter.dev/to/platform-plugins%E2%80%A8To) update CocoaPods, see https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) [8ms]
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2025.1) [8ms]
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 [https://plugins.jetbrains.com/plugin/9212-flutter
•](https://plugins.jetbrains.com/plugin/9212-flutter%E2%80%A8%E2%80%A2) Dart plugin can be installed from:
🔨 [https://plugins.jetbrains.com/plugin/6351-dart
•](https://plugins.jetbrains.com/plugin/6351-dart%E2%80%A8%E2%80%A2) Java version OpenJDK Runtime Environment (build 21.0.7+-13880790-b1038.58)
[✓] Connected device (3 available) [7.7s]
• SM G990E (mobile) • RZCW219FRWZ • android-arm64 • Android 16 (API 36)
• Qib’s iPhone 14 Plus (wireless) (mobile) • 00008110-001421343632401E • ios • iOS 18.6.2 22G100
• macOS (desktop) • macos • darwin-arm64 • macOS 15.6.1 24G90 darwin-arm64
! Error: Browsing on the local area network for Iphone 😍😍😍😍😍. Ensure the device is unlocked and attached with a cable or associated with the same local area
network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
! Error: Browsing on the local area network for Noshad’s Apple Watch. Ensure the device is unlocked and discoverable via Bluetooth. (code -27)
! Error: Browsing on the local area network for iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as
this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
! Error: Browsing on the local area network for Nithiya’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area
network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listp: image_pickerThe Image Picker plugin.The Image Picker plugin.packageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyAndroid applications specificallyteam-androidOwned by Android platform teamOwned by Android platform team
Activity
saurabh-mirajkar commentedon Feb 9, 2026
Thanks for reporting this.
To investigate further, could you please share:
adb logcatoutput)flutter doctor -vpubspec.yaml(especially theimage_pickerversion)flutter-developer04 commentedon Feb 9, 2026
logcat
image_picker: ^1.2.1
saurabh-mirajkar commentedon Feb 9, 2026
Pasted the error logs here: output-logs.txt
[-]ImagePicker.pickImage does not take into consideration new bottom insets for android 15+. Working fine with iOS[/-][+][image_picker] After selection image from gallery in android 16, receiving file object as null[/+]flutter-developer04 commentedon Feb 9, 2026
tsunhousam91 commentedon Feb 10, 2026
same problem here on Android 16.
final XFile? pickedImage = await ImagePicker().pickImage(source: ImageSource.gallery); -> got null
oscarshaitan commentedon Feb 10, 2026
Same problem here on 4 different Pixel devices
the gallery simply returns null with no error
tested with
also tested with pickMultipleMedia same result
in the mean time
https://pub.dev/packages/file_picker
is working fine @tsunhousam91 @flutter-developer04
9 remaining items
johnbonds commentedon May 21, 2026
Not sure if this is related, but suddenly on my android device
assets = await _picker.pickMultiImage(limit: 30);is returning 0 results on actual devices but working just fine in my emulator.
Changing from singleInstance to singleTask fixes the issue for me however I'm also concerned about unintended side effects.
flutter-triage-bot commentedon Jun 16, 2026
This issue is assigned to @gmackall but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!
Ezor commentedon Jun 26, 2026
Hello,
Any news about this issue ? We are encountering the problem on a large set of android 16 devices. And the "launchmode" workaround has too much side effects to be used.
magnus-lpa commentedon Jul 23, 2026
In our case this issue just started happening in some devices, specifically Samsungs with Samsung OneUI 8.5 (Android 16). It worked fine until updating from OneUI 8.0 (also Android 16). It also happens on Pixel 9a with Android 17.
Picking an image from the camera still works, just from the gallery it returns null.
Changing from
android:launchMode="singleInstance"toandroid:launchMode="singleTask"seems to solve the problem, but in our case it would have very negative side effects, so not really a solution.flutter-triage-bot commentedon Sep 1, 2026
This issue was assigned to @gmackall but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.
[image_picker] Fix android-16 not picking up file (#11320)
[image_picker] Fix android-16 not picking up file (flutter#11320)
[image_picker] Fix android-16 not picking up file (flutter#11320)
github-actions commentedon Sep 17, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.