Highlighted

iOS 8 GM and AIR 15 CameraRoll

Community Beginner ,
Sep 11, 2014

Copy link to clipboard

Copied

Hi,

My app, which worked perfectly under iOS7 has suddenly started falling over under iOS8 GM. I have builds under both AIR 14 and AIR 15 which both experience the same problem, so I' pretty sure it's iOS related. I'm running on an iPad 1458.

The issue is when loading images from the camera roll. I'm getting seemingly random "Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error."  when invoking loadFilePromise():


  private function cameraRollMediaSelectHandler(event :MediaEvent): void

  {

  var promise:MediaPromise = event.data as MediaPromise;

  loader = new Loader();

  loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoaded);

  loader.addEventListener(AsyncErrorEvent.ASYNC_ERROR, errorHandlerAsyncErrorEventHandler);

  loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandlerIOErrorEventHandler);

  loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandlerSecurityErrorEventHandler)

  loader.loadFilePromise(promise);

  (FlexGlobals.topLevelApplication as IPleaseWait).pleaseWait( true);

  }

Has anybody else come across this? Any resolutions?

Thanks!

Simon

It's very odd - with some older images, my application falls over the first time I attempt to load it, but works subsequently. I've added error handlers everywhere, but still can't catch it. My recent images work fine.

However, and this is a big however, I'm writing a similar application using Swift, so it's a native app. A very similar issue exists, only the app doesn't crash, it just returns a nil image.

This leads me to believe it's an issue with iOS 8 and *not* with AIR.

So, John and Pravendra, it looks like I was barking up the wrong tree! My apologies and thanks to you both for your help,

Simon

TOPICS
Development

Views

2.4K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

iOS 8 GM and AIR 15 CameraRoll

Community Beginner ,
Sep 11, 2014

Copy link to clipboard

Copied

Hi,

My app, which worked perfectly under iOS7 has suddenly started falling over under iOS8 GM. I have builds under both AIR 14 and AIR 15 which both experience the same problem, so I' pretty sure it's iOS related. I'm running on an iPad 1458.

The issue is when loading images from the camera roll. I'm getting seemingly random "Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error."  when invoking loadFilePromise():


  private function cameraRollMediaSelectHandler(event :MediaEvent): void

  {

  var promise:MediaPromise = event.data as MediaPromise;

  loader = new Loader();

  loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoaded);

  loader.addEventListener(AsyncErrorEvent.ASYNC_ERROR, errorHandlerAsyncErrorEventHandler);

  loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandlerIOErrorEventHandler);

  loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandlerSecurityErrorEventHandler)

  loader.loadFilePromise(promise);

  (FlexGlobals.topLevelApplication as IPleaseWait).pleaseWait( true);

  }

Has anybody else come across this? Any resolutions?

Thanks!

Simon

It's very odd - with some older images, my application falls over the first time I attempt to load it, but works subsequently. I've added error handlers everywhere, but still can't catch it. My recent images work fine.

However, and this is a big however, I'm writing a similar application using Swift, so it's a native app. A very similar issue exists, only the app doesn't crash, it just returns a nil image.

This leads me to believe it's an issue with iOS 8 and *not* with AIR.

So, John and Pravendra, it looks like I was barking up the wrong tree! My apologies and thanks to you both for your help,

Simon

TOPICS
Development

Views

2.4K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 11, 2014 0
Participant ,
Sep 12, 2014

Copy link to clipboard

Copied

Yikes! Seems like there has been a change to CameraRoll ... No camera roll iOS 8 - MacRumors Forums

Anyone else having the problem or know of any workarounds ???

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 12, 2014 0
Sep 12, 2014

Copy link to clipboard

Copied

Thanks for reporting the issue.

We are not able to reproduce the issue at our end. Images are loaded properly on calling loadPromise() method.


However, On calling  loadFilePromise in iOS7, there are two options: Camera Roll and My Photo Streams and in iOS8, All Photos/ Recent" Photos are the options.

Could you please provide us with the sample example to reproduce the issue.

Thanks again,

Pravendra

Adobe Air

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 12, 2014 0
Participant ,
Sep 12, 2014

Copy link to clipboard

Copied

Thanks for replying Pravendra !

So, just to confirm, you should still be able to use the CameraRoll class (CameraRoll - Adobe ActionScript® 3 (AS3 ) API Reference  ) in iOS8 to browse for image data in the system media library(ies) as before and it will bring the relevant areas to browse ?

And then use loadFilePromise(promise)

to load the data ?

Are the 2 options you mentioned for loadFilePromise managed by AIR behind the scenes ? Looking at  Loader - Adobe ActionScript® 3 (AS3 ) API Reference I couldn't see any reference to them.


And presumably, we'd need to rebuild for iOS8 with the latest AIR SDK or we'll have problems with the CameraRoll ?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 12, 2014 0
Community Beginner ,
Sep 12, 2014

Copy link to clipboard

Copied

Hi,

Thanks for the response. As per jotstudio's post - I can't see any option in the loadFilePromise() function to specify the options you mention. Do I still use cameraRoll.browseForImage(options); to browse?

In my app, it seems to fail the first time I attempt to load an image, then, on subsequent loads, it works. Almost as if my camera roll image has been 'promoted' to 'all photos'.

I attached the failing code to my initial post.

Many thanks,

Simon

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 12, 2014 0
Sep 14, 2014

Copy link to clipboard

Copied

Please find the below code which I have used to test CameraRoll:

package

{

  import flash.display.Bitmap;

  import flash.display.BitmapData;

  import flash.display.Loader;

  import flash.display.Sprite;

  import flash.display.StageAlign;

  import flash.display.StageScaleMode;

  import flash.events.Event;

  import flash.events.IOErrorEvent;

  import flash.events.MediaEvent;

  import flash.media.CameraRoll;

  import flash.media.MediaPromise;

  public class CameraRollNew extends Sprite

  {

  public var imgLoader:Loader;

  public var cam:CameraRoll;

  public var promise:MediaPromise;

  public function CameraRollNew()

  {

  super();

  // support autoOrients

  stage.align = StageAlign.TOP_LEFT;

  stage.scaleMode = StageScaleMode.EXACT_FIT;

  cam = new CameraRoll();

  cam.browseForImage();

  cam.addEventListener(MediaEvent.SELECT,onSelect);

  }

  public function onSelect(e:MediaEvent):void{

  promise =  e.data as MediaPromise

  addToStage();

  }

  public function addToStage():void {

  imgLoader = new Loader();

  imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,drawBitmap);

  imgLoader.addEventListener(IOErrorEvent.IO_ERROR, errorHandlerIOErrorEventHandler);

  imgLoader.loadFilePromise(promise);

  }

  protected function errorHandlerIOErrorEventHandler(event:Event):void

  {

  trace("here");

  }

  public function drawBitmap(e:Event):void{

  var myBitmapData:BitmapData = new BitmapData(200,200);

  var image:Bitmap = new Bitmap(myBitmapData);

  image.bitmapData = Bitmap(e.currentTarget.content).bitmapData

  image.width = image.height = 200

  image.x = image.y = 50

  addChild(image);

  }

  }

}

Use this code at your end and please let me know if you still facing any problem

Thanks,

Pravendra

Adobe Air

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 14, 2014 0
Participant ,
Sep 15, 2014

Copy link to clipboard

Copied

Thanks so much for looking at this Pravendra.

I've tested the CameraRoll related features in all our existing apps using the iOS8 GM on an iPad2 and all work as expected (both using live version of our app built using AIR 14 and new builds using the latest AIR 15 build).

So all seems to work fine for our apps. The code we use is practically the same as yours.

Simon, Are you still having problems ???

Very best wishes,

John

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 15, 2014 0
Community Beginner ,
Sep 15, 2014

Copy link to clipboard

Copied

It's very odd - with some older images, my application falls over the first time I attempt to load it, but works subsequently. I've added error handlers everywhere, but still can't catch it. My recent images work fine.

However, and this is a big however, I'm writing a similar application using Swift, so it's a native app. A very similar issue exists, only the app doesn't crash, it just returns a nil image.

This leads me to believe it's an issue with iOS 8 and *not* with AIR.

So, John and Pravendra, it looks like I was barking up the wrong tree! My apologies and thanks to you both for your help,

Simon

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 15, 2014 0
Explorer ,
Sep 29, 2014

Copy link to clipboard

Copied

Yeah, in testing on my newly upgraded ios 8.0.2 iPad Air, it seems all photos prior to the upgrade were moved off the Camera Roll and in to the iOS Photos app. As a result, I no longer had any photos residing on the camera roll and it displayed the stock "use iTunes" message with no ability to access previous photos when calling to the Camera Roll from within the Air application.

However, I've found that if you take a new photo after the iOS upgrade - the photo then resides on the Camera Roll. Then accessing the Camera Roll from the Air app shows that new photo AND also gives you the option to access your photos residing within the Photos app by tapping the "All Photos" option.

On a side note, accessing the CameraUI crashed the Air app when returning the media promise - however with the latest Air 15 Beta (15.0.0.289) and iOS 8.0.2, I haven't been able to replicate the issue. Android is a different story. The old memory crash issue still exists (intermittently) and may force me to use a native extension for Android devices as a result.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 29, 2014 0
Community Beginner ,
Oct 08, 2014

Copy link to clipboard

Copied

Hi Pravendra!

I'm testing your code and it's not working with AIR 15, Flash CC. My app crashes on the device (as did my original code, hence my testing :).

If I publish with Air 14.0.0.137 it works works just fine, but when I test Air 15.0.0.302 (or Air 15.0.0.289) it's crashing.

I've tested on an iPhone 6 and an iPhone 5, both iOS 8.02, only using newly taken photos.

I need to use AIR 15 in my app so I'm pretty much stuck right now.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 08, 2014 0
Oct 10, 2014

Copy link to clipboard

Copied

It’s a known issue and we’re investigating it


Workaround: Disable Faster packaging option while publishing the app from CC 2014


or


while packaging with ADT, include -useLegacyAOT yes to package the app.


-Pravendra

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 10, 2014 1
Adobe Employee ,
Oct 13, 2014

Copy link to clipboard

Copied

Hi,

We have fixed this issue and it should be available in next beta build.

Thanks

Govinda Gupta

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 13, 2014 0
Community Beginner ,
Oct 15, 2014

Copy link to clipboard

Copied

Hi adobe staff , my app has been rejected for apple Store because of this , crashed on iPad Ios8 , and this after 2 weeks of waiting .

I think it is the same reason , so what can i do now , i have to wait for the next beta build , i will be facing a big problem because i'm already late in deadline .

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2014 0
Community Beginner ,
Oct 15, 2014

Copy link to clipboard

Copied

Use the workaround that Pravendra suggests above (Oct 10, 2014 12:43 AM)

You can Google how to see the full ADT command that is used when you build your app in Flash Professional (hint, Console.app)

Then Google where in the call you should add -useLegacyAOT and it should work!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2014 0
Community Beginner ,
Oct 20, 2014

Copy link to clipboard

Copied

Hello , i tried to use ADT to package my app for Apple Store ,that  i used before for debugging , but it seems different because i got some issue " icons missing in the package'.

for test in simulator :

adt -package -target ipa-test-interpreter-simulator -storetype pkcs12 -keystore TrixCertificates.p12 -storepass trix123 myApp.ipa scotchedFCCIOS-app.xml scotchedFCCIOS.swf -extdir ./  -platformsdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk

for app store and device :

adt -package -target ipa-app-store -storetype pkcs12 -keystore TrixCertificates.p12 -storepass trix123 appStore.ipa scotchedIOStore-app.xml scotchedIOStore.swf -extdir ./  -C AppIconsForPublish -useLegacyAOT


  • So first it shows me an error even i have -C AppIconeForPublish

error 303: Icon AppIconsForPublish/50x50.png is missing from package

  • Second how can i add the provisioning profile to my ADT command line

I hope that someone have a working example that i can use to package my app avoid that crash problem when using Camera




Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 20, 2014 0
Community Beginner ,
Oct 20, 2014

Copy link to clipboard

Copied

You should start a new thread as this is unrelated to CameraRoll.

But to help you out, you should specify each and every icon in your ADT call, not only the folder.

You can see the ADT call that Flash Professional actually makes by taking the following steps. Then take the icons part from it and use in your own call.

- Open Applications/Utilities/Console.app (you can type in "Flash" in the Filter text field if you like)

- Publish the app for iOS in Flash Pro

- Copy the ADT command (mine looks like this:)

20/10/14 10:01:49,861 Adobe Flash CC 2014[22284]:

arrParameters content: /Applications/Adobe Flash CC 2014/Adobe Flash CC 2014.app/Contents/jre/jre1.7.0_10.jre/Contents/Home/bin/java -Dfile.encoding=UTF-8 -jar /Applications/Adobe Flash CC 2014/AIR14.0/lib/adt.jar -package -target ipa-app-store -useLegacyAOT no -provisioning-profile /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack/certificates/LineRacer_AppStore.mobileprovision -storetype PKCS12 -keystore /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack/certificates/AppStoreDistributionCertificate.p12 -storepass password /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack/appmain.ipa /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack/appmain-app.xml -C /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack/ appmain.swf icons/icon1024x1024.png icons/icon144x144.png icons/icon100x100.png icons/icon58x58.png icons/icon50x50.png icons/icon152x152.png icons/icon120x120.png icons/icon76x76.png icons/icon72x72.png icons/icon48x48.png icons/icon512x512.png icons/icon114x114.png icons/icon57x57.png icons/icon29x29.png -C /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack/ html -C /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack/ Default-568h@2x.png -C /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack Default-Portrait.png -C /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack/ Default-Portrait@2x.png -C /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack Default.png -C /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack/ Default@2x.png -C /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack/ car_shell_001.dae -C /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack/ car_wheel_001.dae -C /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack/ vehicle_final.ma -C /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack/ vehicle_stages.ma -C /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack/ body.3DS -C /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack/ bumper.3DS -C /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack/ glass.3DS -C /Users/karlthyselius/Dropbox/iOs/Apps/MBKeepOnTrack/ interior.3DS

Then grab and use the important parts for your app

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 20, 2014 2
Community Beginner ,
Oct 20, 2014

Copy link to clipboard

Copied

Thank so much , i could package my app Now , I will submit to Apple Store and See , Actually i could not test my app on  IOS Device , because they have changed the way to install the provision profile on their Devices running with IOS 8 , I tried with itunes , with XCode . but it not installing so i'm not able to test it on any device .

i don't know if you have installed any app for debugging or test on IOS 8 device !! Any Thank You

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 20, 2014 0
Community Beginner ,
Oct 20, 2014

Copy link to clipboard

Copied

The method has not been changed as far as I know. But you can actually do the same thing here: publish the app with your Ad Hoc provisioning profile in Flash Professional and grab the ADT code from Console.app and use it in your own ADT call

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 20, 2014 1
New Here ,
Oct 20, 2014

Copy link to clipboard

Copied

Hi Govinda,

which build will have the fix ?

Thank you.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 20, 2014 0
Participant ,
Oct 23, 2014

Copy link to clipboard

Copied

Hi,

Do we have any idea when the next version of the SDK will be released which fixes this problem?

I have the strange situation where I'm using a RevMov.ane which complies and runs on a device only when Faster Packaging is enabled (via Flash Pro CC 2014).

If I publish the app with Faster packaging disabled the app freezes as it launches.

Thanks,

Mark

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 23, 2014 1
Engaged ,
Oct 23, 2014

Copy link to clipboard

Copied

I'm with Infin8 - wondering when the AIR release will be that fixes this issue?

Fortunately I can use the legacy AOT fine in the meantime, but some people can't

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 23, 2014 0
Participant ,
Nov 05, 2014

Copy link to clipboard

Copied

It's been fixed in AIR 15.0.0.349

-useLegacyAOT yes no longer needed.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 05, 2014 0
Engaged ,
Nov 05, 2014

Copy link to clipboard

Copied

That is fantastic!

But unfortunately I submitted to the app store yesterday with use-legacy set to no

Apart from a faster built time, does setting this to yes give any other noticeable improvements?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 05, 2014 0