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

Native camera crashing on Sony Xperia devices #233

Open
Willhay108-imprint opened this issue Nov 19, 2019 · 1 comment
Open

Native camera crashing on Sony Xperia devices #233

Willhay108-imprint opened this issue Nov 19, 2019 · 1 comment

Comments

@Willhay108-imprint
Copy link

Willhay108-imprint commented Nov 19, 2019

Which platform(s) does your issue occur on?

Android, specifically Sony Xperia devices.

Please, provide the following version numbers that your issue occurs with:

  • CLI: 6.0.3-2019-08-01-075532-13733
  • Cross-platform modules: 1.0.0
  • Runtime(s): 6.0.2(android), 6.1.1(ios)
  • Plugin(s): "nativescript-camera": "^4.5.0",

Please, tell us how to recreate the issue in as much detail as possible.

When taking a photo on my app on a Sony Xperia phone, the camera app reliably crashes upon pressing the circular camera button inside the native camera app. The take picture noise correctly sounds, but no picture is taken, the take photo button is disabled but the camera is still active it never goes to the confirm picture page. After a few seconds a notification pops up to say the camera app has stopped working.

This same code block is used and works correctly on all ios devices I have tried, and all other android devices (a range of phones and tablets), the problem exists reliably only on Sony Xperia phones.

Is there any code involved?

cameraModule.requestPermissions().then(() => {
debugger;
cameraModule.takePicture().then((imageAsset) => {
debugger;
imageSourceModule.fromAsset(imageAsset).then(imageSource => {
debugger;
const savePath = fsModule.knownFolders.documents().path;
const fileName = "img_" + new Date(Date.now()).getTime() + "." + format;
const filePath = fsModule.path.join(savePath, fileName);
if (imageSource.saveToFile(filePath, format, 50)) {
this.new_answer = filePath;
}
}).catch((e)=>{
debugger;
console.log(e);
});

In this code block, the first debugger will hit correctly before the camera app has opened. After pressing the take photo button though, no other debuggers hit and the camera crashes.

@PashaArkus
Copy link

this problem exists on other devices, even on some iphone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants