2
votes

Having some issues getting a release build of an Air IOS Ipad app running (starling based).

I am doing a release build, and saving the ipa file on my drive. I double click the ipa to get it into iTunes, and from there I do an app install onto the iPad.

Once on the ipad, the app fails to load any external files. I put up a preloader, and attempt to load assets via Loadermax, however, it seems to fail.

Here is the code section that the app fails on: (NOTE: this all works in debug mode, both in Air simulator, and debug mode on device via usb)

import com.greensock.events.LoaderEvent;
import com.greensock.loading.ImageLoader;
import flash.filesystem.File;
 ...
 ...
var _imageLoader:ImageLoader;
 ...
 ...
private function loadAssets():void{
  var _appFile:File = File.applicationDirectory;
  _appFile = _appFile.resolvePath("assets/statics/blueImage.png");
  _imageLoader = new ImageLoader(_appFile.nativePath, {onComplete:onImageLoaded, onFail:onImageLoadFail});
}
private function onImageLoaded(e:LoaderEvent):void{
  traceOut("OH MY GOD BATMAN, IT WORKED!!!");   // traceOut is a helper method that prints to a textfield on the display
}
private function onImageLoadFail(e:LoaderEvent):void{
  traceOut("back to the Bat Cave...");
}
...
...

In debug mode, the above code shows:

OH MY GOD BATMAN, IT WORKED!!!

In release build:

back to the Bat Cave...

Anyone know where I am going off the rails? I am not using any ANE's or such.
Based in SDK: "http://ns.adobe.com/air/application/14.0"

2
Are you specifying the external files to be included in the exported IPA? - Alexander O'Mara
Using flash builder, I am specifying the files to be included (folders).... - MikeH
Does it work when using Standard Debug mode or just Fast Debug mode? My guess is you are good in Fast, which is actually just a Flash app, but not okay in Standard, which is a cross-compiled Objective-C app that does not run in the Flash runtime. This would explain why it works in debug and not in release (which is close to Standard Debug). I generally access embedded files using the [Embed()] syntax or, if using Flex, the Embed() syntax. - Josh
The app uses way too many assets for me to embed them all on compile, so I gotta do a loader. I am doing a "Standard" debugging on device. - MikeH
I took a second look at the project build packaging options and I do see the "assets" and "configuration" folders and subcontaining files all checked, however, when I choose to do a release build, I don't see those folders as options to check/uncheck ---- do you think that's where things are going off the rails? Or can I assume that since they are selected via the "project build packaging" options, they are already included? - MikeH

2 Answers

1
votes

PCs are not case sensitive but Ios is. While in simulator or debug mode a file name "myFile" would work even if it's really "myfile" (note the cap difference) on release mode it will fail.

If that doesn't work then try using the url property of File instead of nativePath. Also you can easily check is the file exist prior to loading it:

if(_appFile.exist)

Also when depending on custom frameworks you force yourself on depending on their shortcomings. Use a classic Loader instance to repeat the same operation and see if that one succeed. You'll be surprise the number of times a custom framework can fail on simple operations simply because the way it's setup internally.

1
votes

Firstly, Thank you to to the individuals who assisted in getting to the root of this problem and solving, especially BotMaster.

The issue really has to do with Flashbuilder, and a bug that is associated with it's Build Release wizard.

After reading this: https://forums.adobe.com/message/5750011

What I did was:

  1. click the "Export Release Build" button in Flashbuilder,
  2. IMPORTANT: check the box for "Keep bin-release-temp folder"
  3. Click Next
  4. Click Cancel
  5. Via Windows Explorer, navigated to the bin-debug folder, and copied the "assets" and "configuration" folders to the "bin-debug-temp" folder that was generated by flash-builder
  6. I return to Flash builder, and Click on "Export Release Build" button again.
  7. Check the box for "Keep bin-release-temp folder"
  8. Click Next
  9. Check the boxes beside "assets" and "configuration", Click Finish.

the newly generated ipa file had the folders I required.

Once again, thanks to those who contributed to resolve this bug.