Info:
- Package: image_picker plugin for flutter, version 0.6.3+1
- Android build only, no IOS
Problem:
This is my method to pick an image:
Future<void> pickImage(ImageSource source) async {
File selected = await ImagePicker.pickImage(source: source);
print(selected?.path);
imageFilePath = selected?.path ?? imageFilePath;
}
=> When using ImageSource.gallery, when choosing a picture which is not in cache, 'selected.path' prints null. When selecting a picture which is in cache, it does retrieve it, 'selected.path' prints:
/data/user/0/be.etnic.parrainage_mcf/cache/image_picker2517179621202627006.jpg
Anyone knows what causes this problem and how I can solve it?
Sidenotes:
- I can also pick an image by making a picture directly with ImageSource.camera, this doesn't give me any problems.
- I'm not 100% sure that the selected pictures that return null are not in cache, but the pictures that do return correctly from choosing from the ImageSource.gallery all come from that cache-folder
- I don't have any permissions set in my AndroidManifest.xml (other than Internet permission)