[expo-image-picker][Android] allowsEditing option makes the app crash

See original GitHub issue

🐛 Bug Report

This is for a bare react-native app, not using expo.

Summary of Issue

App crashes when calling launchImageLibraryAsync and launchCameraAsync with allowsEditing: true option.

Environment - output of expo diagnostics & the platform(s) you’re targeting

System:
    OS: macOS 10.15.7
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Memory: 170.03 MB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.8.0 - ~/.nvm/versions/node/v14.8.0/bin/node
    Yarn: 1.22.5 - ~/.nvm/versions/node/v14.8.0/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v14.8.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.0 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
    Android SDK:
      API Levels: 21, 23, 24, 25, 26, 28, 29, 30
      Build Tools: 28.0.3, 29.0.2, 30.0.2
      System Images: android-24 | Google Play Intel x86 Atom, android-26 | Google APIs Intel x86 Atom, android-26 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    Xcode: 12.0/12A7209 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_272 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: ^17.0.1 => 17.0.1
    react-native: 0.63.3 => 0.63.3
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Reproducible Demo

Steps to Reproduce

Just call:

const picture = await launchCameraAsync({
  allowsEditing: true,
  allowsMultipleSelection: false,
});

and

const picture = await launchImageLibraryAsync({
  mediaTypes: MediaTypeOptions.Images,
  allowsEditing: true
});
  1. After calling the functions above, you can take a photo.
  2. Take a photo,
  3. Tap on checkmark.
  4. App will crash.

This issue is not present in iOS BUT on iOS the edit doesn’t allow me to drag the picture on the crop line


Expected Behavior vs Actual Behavior

Should not crash

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
aprilmintacpinedacommented, Oct 27, 2020

@Lalitj03 thank you very much for your response. Your suggestion fixed it. Seems I didn’t do that part, because it wasn’t included here https://docs.expo.io/versions/latest/sdk/imagepicker/#installation, and I didn’t click on the “additional install instructions”.

2reactions
Lalitj03commented, Oct 27, 2020

I was facing a similar issue. The problem was I did not add activity in the AndroidManifest.xml. See the installation guide it may help https://github.com/expo/expo/tree/master/packages/expo-image-picker

Read more comments on GitHub >

github_iconTop Results From Across the Web

When Launching Camera App Crashes - Apple Developer
I am trying to access the camera to take pictures in my app. Here is my code: ... However when I press the...
Read more >
Why do my apps keep crashing on Android, How to fix it
To restart the device, press and hold the power button. Now tap on restart. Some phones may not have the restart option, in...
Read more >
Why Do My Apps Keep Crashing on Android? - Avast
App crashes are a common issue for Android users. When thinking about what's making your favorite app crash, consider how you use your...
Read more >
UIImagePickerController crashes when using PhotoLibrary as ...
The app crashes with UIImagePickerController in two scenarios on the device: 1) when allowsEditing is set to YES, after I crop a picture...
Read more >
Firebase Crashlytics
Get clear, actionable insight into app issues with this powerful crash reporting solution for Apple, Android, Flutter, and Unity.
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