Skip to main content
Inspiring
January 16, 2015
Answered

AIR 16, CameraRoll Android Error

  • January 16, 2015
  • 1 reply
  • 521 views

Hello, I'm trying to use the CameraRoll to access photos on a Galaxy S5 Android device. I'm using the latest version of AIR from the labs.

When I browse for a photo, everything seems to be working correctly, it gives me the options of where to chose from then shows the photos. But anytime I choose a photo, the "ErrorEvent.ERROR" is dispatched and I see the message.

"ERROR #2124: Loaded file is an unknown type."

Has anyone else ever had this problem before? Pretty straight forward code but just doesn't work for me.

if(CameraRoll.supportsBrowseForImage){

var camera:CameraRoll = new CameraRoll();

camera.addEventListener(MediaEvent.SELECT, _onSelect);

camera.addEventListener(Event.CANCEL, _onCancel);

camera.addEventListener(ErrorEvent.ERROR, _onError);

camera.browseForImage();

}

private function _onSelect($event:MediaEvent):void{

    trace("selected");

}

private function _onCancel($event:Event):void{

    trace("cancelled");

}

private function _onError($event:ErrorEvent):void{

    trace("this always fires", $event.text);

}

This topic has been closed for replies.
Correct answer phonefusionryan

turns out I was missing <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

sorry for the spam... please continue on

1 reply

phonefusionryanAuthorCorrect answer
Inspiring
January 16, 2015

turns out I was missing <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

sorry for the spam... please continue on