Error getting image with CameraRoll

Hi guys, I’m getting troubles getting an image from gallery using CameraRoll module. It throws me this error:

Attempt to invoke interface method 'int android.database.Cursor.getColumnIndexOrThrow(java.lang.String)' on a null object reference
  • Fuse version: 0.32.0 (build 9290)
  • Operating system: OS X El Capitan 10.11.6
  • Android version: 5.1.1 LMY47V based on MIUI 8.1

Thanks :slight_smile:

What is the code you are using to get this error?

function getImage() { 
  CameraRoll.getImage()
    .then(function(image) { 
      console.log("CameraRoll :D"); 
      encodeImage(image);
    }, function(error) {
      console.log("Error: " + error)
    });
}

module.exports = {
 getImage : getImage
 } 

Doesn’t print the “CameraRoll :D” message.

So to be precise; you’re getting the image picker up, you select an image, and then you get the error? Or does this error fire immediately when you use the API?

I’ve rewritten the code producing the error you encountered to a better approach that should fix your issue :slight_smile:

A fun thing on Android, writing an approach that is sane for 99% of devices, is when you encounter the 1%. Thanks for finding this for us!

Thank you very much, awesome support!