question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android][ImagePicker] launchImageLibraryAsync doesn't return

See original GitHub issue

šŸ› Bug Report

launchImageLibraryAsync only returning/completing some of the time, in most cases nothing happens once selecting an image.

Environment

Android testing device details: Alba 57, Android 8.1.0

Expo CLI 3.0.9 environment info: System: OS: macOS 10.14.6 Shell: 5.3 - /bin/zsh Binaries: Node: 12.6.0 - /usr/local/bin/node npm: 6.10.0 - ~/.npm-global/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman IDEs: Xcode: 10.3/10G8 - /usr/bin/xcodebuild npmPackages: expo: ^33.0.0 => 33.0.7 react: 16.8.3 => 16.8.3 react-native: https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz => 0.59.8 react-navigation: 3.0.0-rc.4 => 3.0.0-rc.4 npmGlobalPackages: expo-cli: 3.0.9

iOS and android standalone apps, built via expo build:<>

Steps to Reproduce

I am simply pressing a button which launches the imagePicker and selecting an image and then saving the result to state. I am also console logging the result to check.

Expected Behavior

I expect some data to be logged to the console and the state to be updated with the imagePicker image result

Actual Behavior

The modal for selecting the image goes away, but no data is output to the console and the state isnt updated with the imagePicker result

Reproducible Demo

https://snack.expo.io/@virtuallast/spunky-cake

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rossbccommented, Aug 26, 2019

I needed to download the update to Expo, I got it from the playstore originally, and it was version 2.12.0 - I updated to 2.12.2, but still the same issue. The phone version is android 8, all patches up to date.

I have a radio button component on a page where I choose an image source; from gallery, camera or file. I use the image picker for the first 2 choices and the document picker for the 3rd.

Doc picker worked every time. Image picker worked once or twice, then nothing unless I canceled the action. Imagepicker version was 6.0.0, doc picker is 6.0.0 as well. Only way to get it to work was to reboot the mobile device I was testing on. After updating to 2.12.2 I was able to do 5 or 6 straight image uploads and 5 to 6 camera uploads, so I think that was my issue. Thanks for helping me get through that!

Brian /) /) /)/)

On Monday, August 26, 2019, 10:31:52 AM EDT, Charlie Cruzan <notifications@github.com> wrote:  

Just tested this on an emulator (Android 9) and it’s working each time. Will need to repro this before we can look into this properly (please use the snack I linked above since it’s working for me). Couple things:

  • make sure you’ve updated the Expo Client app (you should us v2.12.2)
  • I’m using ā€œexpo-image-pickerā€: ā€œ~6.0.0ā€, you can install it with expo install expo-image-picker
  • If this only happens sometimes, then let me know how many times you usually have to launch ImagePicker before the crash happens (I launched and selected about 10 times in a row and didn’t see any issues)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

0reactions
cruzachcommented, Aug 26, 2019

Just tested this on an emulator (Android 9) and it’s working each time. Will need to repro this before we can look into this properly (please use the snack I linked above since it’s working for me). Couple things:

  • make sure you’ve updated the Expo Client app (you should us v2.12.2)
  • I’m using "expo-image-picker": "~6.0.0",, you can install it with expo install expo-image-picker
  • If this only happens sometimes, then let me know how many times you usually have to launch ImagePicker before the crash happens (I launched and selected about 10 times in a row and didn’t see any issues)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Expo Image Picker -- not returning image from Android ...
I am using the expo image picker to pick the image and return to the ... the image randomly -- it doesn't seem...
Read more >
ImagePicker - Expo Documentation
On Android: a promise that resolves to an array of objects of exactly same type as in ImagePicker.launchImageLibraryAsync or ImagePicker.launchCameraAsync ifĀ ...
Read more >
Using Image Picker and Camera in React Native (Expo)
The iOS simulator doesn't allow a virtual camera at this time but you can try it with your ... return; } const result...
Read more >
How to use the expo-image-picker.launchImageLibraryAsync ...
launchImageLibraryAsync function in expo-image-picker. To help you get started, ... CAMERA_ROLL, 'android')) { const { cancelled, uri } = await ImagePicker.
Read more >
Why does my image picker result display properly on web but ...
launchImageLibraryAsync ({ mediaTypes: ImagePicker. ... On iOS, the default image file just straight up doesn't change and on Android,Ā ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found