capacitor icon indicating copy to clipboard operation
capacitor copied to clipboard

bug: Camera plugin restart app when take a photo

Open fititrick opened this issue 4 years ago • 37 comments

Bug Report

Capacitor Version

npx cap doctor output: Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 2.1.0

@capacitor/core: 2.1.0

@capacitor/android: 2.1.0

@capacitor/electron: 2.1.0

@capacitor/ios: 2.1.0

Installed Dependencies:

@capacitor/electron not installed

@capacitor/cli 2.1.0

@capacitor/android 2.1.0

@capacitor/ios 2.1.0

@capacitor/core 2.1.0

[success] Android looking great! 👌 Found 3 Capacitor plugins for ios: @codetrix-studio/capacitor-google-auth (2.1.1) @rdlabo/capacitor-facebook-login (2.0.2) cordova-plugin-nativegeocoder (3.4.1) [success] iOS looking great! 👌

Affected Platform(s)

  • [x] Android
  • [ ] iOS
  • [ ] Electron
  • [ ] Web

Current Behavior

When calling the method const image = await Camera.getPhoto ({        quality: 70,        allowEditing: false,        resultType: CameraResultType.Uri,        promptLabelHeader: 'Camera',      promptLabelCancel: 'Cancel',      promptLabelPhoto: 'Image Gallery',      promptLabelPicture: 'Take Photo'      });

The application to take photography is shown. When the photo is taken, the application restarts. Reviewing in Android Studio, the app process dies, and another instance of the app opens.

Expected Behavior

The application takes the photo and returns the url to the controller without restarting the app.

Sample Code or Sample Application Repo

const image = await Camera.getPhoto ({        quality: 70,        allowEditing: false,        resultType: CameraResultType.Uri,        promptLabelHeader: 'Camera',      promptLabelCancel: 'Cancel',      promptLabelPhoto: 'Image Gallery',      promptLabelPicture: 'Take Photo'      });

Reproduction Steps

Other Technical Details

npm --version output: 6.13.7

node --version output: v10.15.1

pod --version output (iOS issues only):

Other Information

In this video you can see how when trying to take a photo from a xiaomi, the app process stops and restarts after taking the photo. Sometimes the method works correctly. YouTube link: https://youtu.be/GfvSIJ5SpwE

fititrick avatar May 15 '20 07:05 fititrick