Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Frequent Crash with Taking photos with ios 8 and sdk 3.4.0

$
0
0

After taking a photo and press "Use photo" button the app crash and i recive this error:

Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates. [WARN] : Received memory warning.

my code to open the camera is

function openCameraButton() {
    Titanium.Media.showCamera({
        success : function(event) {
            // called when media returned from the camera
            //alert('Our type was: ' + event);
            if (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {
                addPreviewImage(event.media);
                //alert('Our type was: ' + event.mediaType);
            } else {
                //alert("got the wrong type back =" + event.mediaType);
            }
        },
        cancel : function() {
            // called when user cancels taking a picture
        },
        error : function(error) {
            // called when there's an error
            var a = Titanium.UI.createAlertDialog({
                title : 'Camera'
            });
            if (error.code == Titanium.Media.NO_CAMERA) {
                a.setMessage('Please run this test on device');
            } else {
                a.setMessage('Unexpected error: ' + error.code);
            }
            a.show();
        },
        saveToPhotoGallery : true,
        // allowEditing and mediaTypes are iOS-only settings
        allowEditing : true,
        mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO]
    });
}

Anyone experienced this error?

Thank you. T


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>