Frequent camera crashes on android


#1

I keep getting the following crash when using Camera on Android phone:

http://pastebin.com/p3xVRFDX

This is irrespective of the device. I’ve used Mogo G, 1st Gen and Samsung Galaxy S2. On both the devices, I keep getting this crash quite frequently. There are no specific patterns or steps to reproduce though. How do I fix it?


#2

Sometimes and very often on old phones… android closes the previous opened app to provide more memory to the camera.

Do not know if that behavior results in this error message. but sometimes i opened the camera in motog first and second edition and android 4.x the app was killed by android.

Can not reproduce this on android 5 any more.


#3

You ever find a solution? I have similar problem. I only have a Moto G to test with and it crashes all the time with camera/gallery use.

When using GenyMotion with fake Samsung Galaxy S4, the same thing happens.


#4

My phone had become very slow. I did a factory reset on my phone and now it works. But it still keeps crashing once in a while. I couldn’t find any solution to it.


#5

Hello, I’m still having this problem. Anyone found an a solution?? Greetings


#6

anyone solve this? this is a sporadic error only happening on older phones.


#7

Yes, It seems to happens on low RAM devices. The only thing I could do is do a better performance of code. Set a lower width and height camera resolution and quality helps too. Greetings


#8

I have it set on 200x200 with a quality of 50. what did you use?


#9

Well, I was able to set it to 500 and no problems. What cellphone are you using? Are you testing on Ionic View apk? I recommend you to use also the Take Picture or get Picture function as an a service function. Greetings


#10

I am testing on an android SM-J100H and barcode scanner works its just the camera. I have looked at the devices hardware and the available ram is sitting at 125mb.


#11

You may try either use another cellphone with more memory (installing the Ionic View there) to test if it is a low memory problem. Or kill the apps that are currently running on your cellphone to free the most possible your cellphone’s RAM. My code bellow: It is implemented in a service file. Notice that the CAPITAL words are variables. You may set them to a value directly. I realized that setting saveToPhotoAlbum to false increases a lot memory performance. Code:

    takePicture:function() {            
        var options = { 
            quality: PICTURES_CAMERA_QUALITY, 
            destinationType:1,//FILE_URI,
            sourceType: $cordovaCamera.CAMERA,
            encodingType: $cordovaCamera.JPEG,
            targetWidth:PICTURES_CAMERA_WIDTH_TARGET,
            targetHeight:PICTURES_CAMERA_HEIGHT_TARGET,
            saveToPhotoAlbum:false,
            correctOrientation:true,
        };
        return $cordovaCamera.getPicture(options).then(function(imageURL) {
            $cordovaCamera.cleanup();
            return doSomethingWithThePicture();
        }, function(err) {               
            alert("Error");
            return false;                
        });                    
    },

#12

I cant use another phone it has to be a universal app. I just going to have to trail and error this one.