jibon57 / nativescript-mediafilepicker

A complete file picker solution for NativeScript
Apache License 2.0
51 stars 39 forks source link

Android Application Crash when using Camera with NativeScript 6 #83

Closed jabrware closed 4 years ago

jabrware commented 5 years ago

Describe the bug After taking photo and clicking accept in the preview screen then android application crash or restarted. Also during build process there is a warn about deprecated methods in NativeScript 6 Camera_PreviewCallback.java uses or overrides a deprecated API

To Reproduce

Expected behavior Photo should be selected after accepting preview

NativeScript Info(please run tns info): Component nativescript has 6.0.3 version and is up to date.

Sample Code(please provide minimum code to reproduce problem):

let options: ImagePickerOptions = {
            android: {
                isCaptureMood: false,
                isNeedCamera: true,
                maxNumberFiles: 10,
                isNeedFolderList: true
            }, ios: {
                isCaptureMood: false,
                maxNumberFiles: 10
            }
        };
        let mediafilepicker = new Mediafilepicker();
        mediafilepicker.openImagePicker(options);

        mediafilepicker.on("getFiles", function (res) {
            let results = res.object.get('results');

            if (results) {
                for (let i = 0; i < results.length; i++) {
                    let result = results[i];
                    let file = result.file;
                    console.log(file);
                }
            }});

Additional context Add any other context about the problem here.