-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
flutter/plugins
#3194Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 2.2Found to occur in 2.2Found to occur in 2.2found in release: 2.3Found to occur in 2.3Found to occur in 2.3has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: 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 specifically
Description
It seems this check in ImagePickerDelegate.java does not work in Android 11:
private void launchTakeImageWithCameraIntent() {
.
.
.
boolean canTakePhotos = intentResolver.resolveActivity(intent);
if (!canTakePhotos) {
finishWithError("no_available_camera", "No cameras available for taking pictures.");
return;
}I have tested this in an emulator (API 30) and it throws the error "no_available_camera". If I comment out that code, I can take a photo with the emulator normally. Also one user has already reported me an issue he cannot take photos in my app with his Pixel 3 / Android 11 (my app targets API 30).
I think the issue is related to this:
https://stackoverflow.com/questions/62535856/intent-resolveactivity-returns-null-in-api-30
So the issue is here:
new IntentResolver() {
@Override
public boolean resolveActivity(Intent intent) {
// this check does not work in API 30
return intent.resolveActivity(activity.getPackageManager()) != null;
}
},image_picker: ^0.8.1+2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 2.2Found to occur in 2.2Found to occur in 2.2found in release: 2.3Found to occur in 2.3Found to occur in 2.3has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: 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 specifically