Skip to content

Method openCamera() calls native exception from androidΒ #2219

@ODimash

Description

@ODimash

Exception log:
Uncaught (in promise, id: 3): "java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.io.File.exists()' on a null object reference"

Appears after calling ImagePicker.openCamera():

ImagePicker.openPicker({
          width: 300,
          minHeight: 400,
          cropping: true,
        }).then(image => {
          const updatedImages = [...newImages, { path: image.path }];
          setNewImages(updatedImages);
          uploadImage(image);
        });

I'm check that:

  • Permission for camera granted
  • gradle cleaned and rebuilded
  • ImagePicker.openPicker() works correctly

Versions:

  • react-native: ^0.82.1
  • react-native-image-crop-picker: ^0.51.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions