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.

imagePicker Crashing with Expo 31.0.0 Android 8.1

See original GitHub issue

Environment

Expo CLI 2.4.1 environment info: System: OS: macOS 10.14.1 Shell: 3.2.57 - /bin/bash Binaries: Node: 9.4.0 - ~/.nvm/versions/node/v9.4.0/bin/node npm: 6.4.1 - ~/.nvm/versions/node/v9.4.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman IDEs: Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: expo: ^31.0.2 => 31.0.5 react: 16.5.0 => 16.5.0 react-native: https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz => 0.57.1 react-navigation: 1.5.11 => 1.5.11 npmGlobalPackages: expo-cli: 2.4.1

The device crashing is a Moto X4 Android 8.1

Steps to Reproduce

You can try the project here: https://expo.io/@receiptcoin/receiptchain

Taking a photo using the camera doesn’t crashes the app.

Here is the code I’m using

async componentDidMount() {
    console.log('camera screen mounted');
    const { status } = await Permissions.askAsync(Permissions.CAMERA);
    const cameraRollPermission = await Permissions.askAsync(Permissions.CAMERA_ROLL);
    const status_roll = cameraRollPermission.status;
    console.log('status and status camera is ' , status)
    console.log('status and status roll is ' , status_roll)
    if (status !== 'granted') {
      alert('Please grant app access to the camera so you can upload your photo.');
    }
    if (status_roll !== 'granted') {
      alert('Please grant app access to the camera roll so you can upload your photo.');
    }
    //this.takePhoto();
  }

  takePhoto = async () => {
    console.log('take photo called')
    const pickerResult = await ImagePicker.launchCameraAsync({
      allowsEditing: true,
      aspect: [4, 4],
      exif: true,
    });
    console.log('picker result is ' , pickerResult);
    this.handleImagePicked(pickerResult);

Both permissions are granted on the user’s moto X4, but the app still crashes upon the ImagePicker.launchCameraAsync call.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:11
  • Comments:30 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
avinashlng1080commented, Jun 6, 2019

Guys, do we have an update on this ? The problem persists.

3reactions
oliverkuchiescommented, Aug 9, 2019

Issue continues to persist for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Latest Expo SDK topics - Forums
Topic Replies Views Activity Safe to use payments in production? 1 257 December 21, 2018 Error: Unable to open URL: about:srcdoc 4 3146 December 21,...
Read more >
App crashes when picking image with expo-image-picker
When building the apk for my app and using it that way on the Android Emulator on Windows, the App crashes every time...
Read more >
CHANGELOG.md · 熊刚/Expo - Gitee.com
Changelog. This is the log of notable changes to the Expo client that are developer-facing. Package-specific changes not released in any SDK will...
Read more >
@expo/config-plugins | Yarn - Package Manager
This is the log of notable changes to the Expo client that are developer-facing. Package-specific changes not released in any SDK will be...
Read more >
task :expo-modules-core:compiledebugjavawithjavac failed
Error: /home/user/Desktop/app/android/gradlew exited with non-zero code: 1 ... expo-linear-gradient@8.1.0 from ... Stacktrace (if a crash is involved).
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