Skip to main content
Known Participant
January 23, 2014
Question

UICamera UICameraRoll issue with Android 4.4

  • January 23, 2014
  • 1 reply
  • 1255 views

Hi there,

I am exeriencing an issue with CameraUI and CameraRollUI under Android 4.4 (KitKat) latest version.

I once followed this example http://www.adobe.com/devnet/air/articles/uploading-images-media-promise.html and adapted the code to my project, but it seems it won't work anymore with Android 4.4. When I try to import an image with one of this two classes, I get an ioError : Error #2044: Unhandled ioError:. text=Error #3003: File or directory does not exist. file: /storage/emulated/0/Pictures/IMG_20140123_103840.jpg

Here is the portion of code I use for CameraRollUI (it is the same for CameraUI)

private function onImageSelectComplete( e:MediaEvent ):void

{

    var imagePromise:MediaPromise = e.data as MediaPromise;

    if( imagePromise.isAsync )

    {

        var eventSource:IEventDispatcher = _dataSource as IEventDispatcher;

        eventSource.addEventListener( Event.COMPLETE, readMediaData ); 

    }

    else

    {

        readMediaData();

    }

}

The Event.COMPLETE is never fired because of the wrong path returned by the MediaPromise class. Everything works fine under iOS or other versions of Android

Did someone experienced the same issue and found a workaround ?

Thanks

PS : here is the whole code of my class including the native picture orientation detection method I use  http://pastebin.com/RrTEucLv

This topic has been closed for replies.

1 reply

Participant
April 6, 2014

I am experiencing the same issue... did you find the solution?

8power8Author
Known Participant
April 6, 2014

@davidko this fixed the issue for me :

Check that those two lines are present in the Android manifest part of the application xml descriptor :

<manifest android:installLocation="auto">

     ...

     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

     ...

</manifest>

Though not required with older Android versions, I found thaht they must be there (even if you don't use any "external storage" in your app) starting with Android 4.3