Monday, September 26, 2011

Adobe AIR for Mobile: Adventures in Frustration

For work I am currently banging my head on an Adobe AIR project that will be deployed into iOS and Android phone/tablet apps.

There seem's to be an ever growing list of things that just "don't work right" in the language (at least compared to if I was writing things natively.).. and unfortunately the documentation/community is severely lacking.

Recently I was 100% stumped by a single build error for an entire weekend - it came out of no where, and it makes no sense at all. (I only found the solution by painstakingly merging changes from my current code into a 3 day old build, and building after each change).

The build issue:


When doing a release build of my AIR project in Flash Builder 4.5 I was receiving the strangest error ever:
Error occurred while packaging the application: Warning: 'function nextResult' contains a verify error at offset 757174. The body of this method will be replaced with 'throw VerifyError.


There was a nice long stack trace included as well, that pointed to absolutely nothing in my own code - (no way I am going to type this guy up!)



So what was the culprit? The code below (note, not even part of the referenced nextResult function!)

Bad Code (???)
[javascript]
switch(currentState)
{
case "Splash2":
{
// restart_clickHandler(null);
// break;
}
case "LangLoc":
{
restart_clickHandler(null);
break;
}
default:
{
break;
}
}
[/javascript]

After tweaking the case block below to have its own break (see below) statement, the Export Release Build worked perfectly (I think).

Good Code
[javascript]
switch(currentState)
{
case "Splash2":
{
restart_clickHandler(null);
break;
}
case "LangLoc":
{
restart_clickHandler(null);
break;
}
default:
{
break;
}
}
[/javascript]

Not cool Adobe. Not cool.

3 comments:

  1. i just hit this bug this morning. Thanks for the post.

    ReplyDelete
  2. Thanks for posting. This sucks.

    ReplyDelete
  3. Thanks your information.And if you need look spy app,I will share for you good spy app,please visit site. It is a great tool to spy on other people’s chats, call logs, and multimedia files without letting them know.

    ReplyDelete