Copy link to clipboard
Copied
Hello,
I am testing on Galaxy S7, Android 7.0 and AIR SDK 25
Tried following CameraUI examples and asking for permissions, yet the images taken are never loaded:
Media captured...
Asynchronous media promise.
Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type.
Tracing the mediapromise URL returns:
file:///data/user/0/******/cache/Pictures/IMG_20170803_1517591533635246.jpg
(*** above are my package name)
Any ideas?
Copy link to clipboard
Copied
Just tried AIR 24 - 25 - 26, same issue, cannot load any image from CameraUI.
Made sure to add
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
I tried imagePromise.open(); and waiting for the data to load, but bytes loaded have 0 in length
Copy link to clipboard
Copied
You have the camera permission as well?
Copy link to clipboard
Copied
Yes Iam asking for it via requestPermission. The camera opens and I take a picture. But when I press OK the Image is never loaded.
Copy link to clipboard
Copied
Show your code then starting with the event handling the promise > (MediaEvent.COMPLETE)
Copy link to clipboard
Copied
ASWC wrote
Show your code then starting with the event handling the promise > (MediaEvent.COMPLETE)
I also checked on Samsung J5, Android 6.0.1, same issue, here is the code:
private var deviceCameraApp:CameraUI = new CameraUI();
private var imageLoader:Loader;
private function barClicked(e:MouseEvent):void
{
//dispatchEvent(new MouseEvent(MouseEvent.CLICK));
if( !CameraUI.isSupported ) return;
if(CameraUI.permissionStatus != PermissionStatus.GRANTED)
{
deviceCameraApp.addEventListener(PermissionEvent.PERMISSION_STATUS, permissionChange, false, 0, true);
try {
deviceCameraApp.requestPermission();
} catch(e:Error)
{
// another request is in progress
}
return;
}
connectCamera();
}
private function permissionChange(ev:PermissionEvent):void
{
if (ev.status == PermissionStatus.GRANTED)
connectCamera();
}
private function connectCamera():void
{
deviceCameraApp.addEventListener( MediaEvent.COMPLETE, imageCaptured );
deviceCameraApp.addEventListener( Event.CANCEL, captureCanceled );
deviceCameraApp.addEventListener( ErrorEvent.ERROR, cameraError );
deviceCameraApp.launch( MediaType.IMAGE );
}
private function imageCaptured( event:MediaEvent ):void
{
trace( "Media captured..." );
var imagePromise:MediaPromise = event.data;
if( imagePromise.isAsync )
{
trace( "Asynchronous media promise." );
imageLoader = new Loader();
imageLoader.contentLoaderInfo.addEventListener( Event.COMPLETE, asyncImageLoaded );
imageLoader.contentLoaderInfo.addEventListener( IOErrorEvent.IO_ERROR, cameraError );
imageLoader.loadFilePromise( imagePromise);
}
else
{
trace( "Synchronous media promise." );
imageLoader.loadFilePromise( imagePromise );
showMedia( imageLoader );
}
}
private function captureCanceled( event:Event ):void
{
trace( "Media capture canceled." );
}
private function asyncImageLoaded( event:Event ):void
{
trace( "Media loaded in memory." );
showMedia( imageLoader );
}
private function showMedia( loader:Loader ):void
{
this.addChild( loader );
}
private function cameraError( error:ErrorEvent ):void
{
trace( "Error:" + error.text );
}
Copy link to clipboard
Copied
I also tried:
actionscript 3 - AS3 ios cameraUI save and load image fails, why? - Stack Overflow
But "dataSource.readBytes( imageBytes );" is filling imageBytes with length zero so I am guessing the file does not exist.
As I said before I also tried loading the file via its URL but it says it does not exist.
Copy link to clipboard
Copied
just as an update. the app runs fine on ios. the issue seems with android. So to summarize:
CameraUI does not work on android air sdk 24 25 or 26.
Makes you doubt the QA of the air sdk and that whole roadmap thing . . . There is something broken in how you manage your releases. You fix something and break another major thing.
We are switching to another platform as we cannot just wait for you guys to fix what should be working out of the box. Either open source it if you cannot fix it or just quit.
Copy link to clipboard
Copied
When Take Photo and temp image file is made by device
First Path is temp Dictionary
and After Path is Gallery Dictionary
When I Load Photo path is Changed
so Cannot load photo because I got path temp Dictionary path
Copy link to clipboard
Copied