Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera Plugin will crash the app if no photo app installed in Android #1845

Closed
4 tasks
mrahmadt opened this issue Aug 4, 2019 · 2 comments
Closed
4 tasks

Comments

@mrahmadt
Copy link

mrahmadt commented Aug 4, 2019

Description of the problem:

App will crash if no photo app installed in the device and camera app will not work,

catch {"message":"Unable to create photo on disk"}"
java.io.IOException: No such file or directory

Affected platform

  • [X ] Android
  • iOS
  • electron
  • web

OS of the development machine

  • [ X] Windows
  • macOS
  • [ X] linux

Other information:

Full log
https://www.dropbox.com/s/vgpwx34vf82bz5a/log-2.json?dl=0

Capacitor version:
$ ionic info

Ionic:

Ionic CLI : 5.2.3 (/home/x/.nvm/versions/node/v12.6.0/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.6.2
@angular-devkit/build-angular : 0.801.1
@angular-devkit/schematics : 8.1.1
@angular/cli : 8.1.1
@ionic/angular-toolkit : 2.0.0

Capacitor:

Capacitor CLI : 1.1.0
@capacitor/core : 1.1.0

Utility:

cordova-res : not installed
native-run : not installed

System:

NodeJS : v12.6.0 (/home/x/.nvm/versions/node/v12.6.0/bin/node)
npm : 6.9.0
OS : Linux 4.4

node version:
12.6.0
npm version:
6.9.0
CocoaPods version:

Steps to reproduce:

Plugins.Camera.getPhoto({
  allowEditing: false,
  quality: 50,
  source: CameraSource.Prompt,
  correctOrientation: true,
  // height: 320,
  width: 300,
  //resultType: CameraResultType.Base64
  resultType: CameraResultType.DataUrl
})
  .then(image => {
    console.log('onPickImage then');
    alert('THEN');
    //this.selectedImage = image.base64Data;
    //this.imagePick.emit(image.base64Data);
    this.selectedImage = image.dataUrl;
    this.imagePick.emit(image.dataUrl);

  })
  .catch(error => {
    console.log('onPickImage catch',error);
    alert('error');
    if (this.usePicker) {
      this.filePickerRef.nativeElement.click();
    }
    return false;
  });

Link to sample project:

@jcesarmobile
Copy link
Member

The "Unable to create photo on disk" has been fixed here: #2016

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 13, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants