[Android] I can open the image picker, select an image or take a photo but the photo never comes back to my javascript.
See original GitHub issueHi, I have managed to make it work on iOS. I can flawlessly take a photo or select an image from my library.
On ANDROID though, I can select a photo, or take a picture from the camera, but when I click ok and it returns to my app, the response callback never gets called. It only gets called when I cancel the picker window.
That is my code:
onImageEditClick(){
console.log('Opening image picker: ', ImagePicker.showImagePicker);
ImagePicker.showImagePicker(imgPickerOptions, (response) => {
//CODE from HERE and below will never run on Android (except from when a user cancels the picker window)
console.log('Response = ', response);
if (response.didCancel) {
console.log('User cancelled image picker');
}else if (response.error) {
console.log('ImagePicker Error: ', response.error);
}else if (response.customButton) {
console.log('User tapped custom button: ', response.customButton);
}else {
// You can display the image using either data:
const newPhoto = 'data:image/jpeg;base64,'+response.data;
console.log(newPhoto);
this.props.actions.updateProfilePhoto(newPhoto, this.TOKEN, this.props.global.isDev)
}
});
}
My biggest problem is I get no obvious errors, neither on logcat
nor on js. I’m using 0.19.5 on a Nexus 5 with Marshmallow 6.0.1 what to do -?
Edit: My logcat says this:
E/mm-camera-intf: mm_camera_poll_thread_del_poll_fd: invalid handler 55296 (0)
E/QCamera3Channel: virtual qcamera::QCamera3Channel::~QCamera3Channel(): deleting channel 56067
E/mm-camera-intf: mm_camera_poll_thread_del_poll_fd: invalid handler 55808 (0)
E/mm-camera: isp_unlink_sink_port: E
E/mm-camera-img: faceproc_save_album:774] Error No album
E/mm-camera-img: faceproc_comp_eng_destroy: Album save failed -1
E/QCamera3Channel: virtual qcamera::QCamera3Channel::~QCamera3Channel(): deleting channel 55041
E/QCamera3Channel: virtual int32_t qcamera::QCamera3PicChannel::stop(): Attempt to stop inactive channel
E/mm-camera: isp_unlink_sink_port: E
E/QCamera3Channel: virtual qcamera::QCamera3Channel::~QCamera3Channel(): deleting channel 55554
E/QCamera3Channel: virtual qcamera::QCamera3Channel::~QCamera3Channel(): deleting channel 54528
E/mm-camera-intf: mm_stream_get_v4l2_fmt: Unknown fmt=78
E/mm-camera: mct_pipeline_get_stream: stream not found in the list
E/QCamera3Channel: virtual int32_t qcamera::QCamera3Channel::stop(): Attempt to stop inactive channel
E/QCamera3Channel: virtual int32_t qcamera::QCamera3Channel::stop(): Attempt to stop inactive channel
E/QCamera3Channel: virtual qcamera::QCamera3Channel::~QCamera3Channel(): deleting channel 56576
E/mm-camera: mct_pipeline_get_stream: no children
E/mm-camera: mct_pipeline_process_set:1451: Couldn't find stream
E/ANDR-PERF-LOCK: Failed to reset optimization for resource: 4 level: 0
Thank you.
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (4 by maintainers)
Top Results From Across the Web
[Android] I can open the image picker, select an image or take ...
[Android] I can open the image picker, select an image or take a photo but the photo never comes back to my javascript....
Read more >android pick images from gallery - Stack Overflow
Sometimes, you can't get a file from the picture you choose. It's because the choosen one came from Google+, Drive, Dropbox or any...
Read more >ImagePicker - Expo Documentation
expo-image-picker provides access to the system's UI for selecting images and videos from the phone's library or taking a photo with the camera....
Read more >image_picker | Flutter Package - Pub.dev
Image Picker plugin for Flutter. A Flutter plugin for iOS and Android for picking images from the image library, and taking new pictures...
Read more >Capturing an image from the user - web.dev
In Chrome and Safari on iOS and Android this method will give the user a choice of which app to use to capture...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok my problem was resolved when I added
super.onActivityResult(requestCode, resultCode, data);
to myMainActivity
’sonActivityResult
method.I don’t understand the error but as long as it is resolved, I’m happy.
For others using fbsdk you will also have to do that as well. I will add a pull request to the Readme so that others don’t waste a day on this.
thanks