Skip to main content
Known Participant
Jan 23, 2014 10:10 AM UTC
Question

UICamera UICameraRoll issue with Android 4.4

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 is closed to new replies. Start a new post to keep the conversation going.

2 replies

Participant
Apr 6, 2014 7:05 AM UTC

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

Translate
8power8Author
Known Participant
Apr 6, 2014 12:37 PM UTC

@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

Translate