Grails Flex Plugin 0.4 doesn’t work with Flex 4.5

I have a freelance opportunity, creating apps for Middle East telco company. The requirement is actionscript (Flex and Flash).

Honestly, I haven’t had any experience using the technology but I’ve confidence in myself I can pick up this technology fast enough to deliver. Anyway, nothing written in black and white yet, at the moment.

I did some homework, downloading actionscript e-books (well, I haven’t read it yet), looking for good IDE, and find some necessary tools and tips (thanks Google).

Apparently, Grails have Flex plugin and the 5-rating appeals me to try it. So, here we go..

I download latest Flex library to my local (it’s version 4.5). Create new simple Grails project in my IntelliJ IDEA and install the Flex plugin. The latest version is 0.4.

I follow the manual here. It’s a good documentation.

But well, things didn’t work as expected. I might have missed some steps.

Here are some additional steps I add to solve issues encountered:

1. I need to change manually the player version. from 10.0 to 10.2.  There are two files is being affected here: flex-webtier-config.xml and flex-config.xml. These two files are generated when we do “grails flex-init”.

2. I don’t 100% copy the mxml file in the documentation. I keep the using the generated one. The namespace are a little bit different.  Put “mx:RemoteObject” under “fx:Declarations”,  the script is under “fx:Script” instead of “mx:Script”

3. I change the code style. refer to this link. How we access fields.

From

object.property

to

object[“property”]

Otherwise, I will stuck with error message like this:

Access of possibly undefined property %PROPERTY_NAME% through a reference with static type %CLASS_NAME%

But still I hit another error when I run the apps and try to access the Main.mxml.

The error is as follow:

java.lang.NoSuchMethodError: flex2.compiler.CompilerAPI.encode

I check the plugin source code. It seems that it only meant for Flex 4.0. Look at the flex-webtier.jar and flex-webtier-jsp.jar. All are Flex 4.0 library.

I tried to find jars for version 4.5. but could not found it in the FLEX_HOME path.

So, I decide to downgrade from Flex 4.5 to Flex 4.0 and see. I believe it would work.

Huff, I lost half day just for this.

Mr. Burt Beckwith has created excellent plugin. Just that he forgot to mention that It doesn’t work for Flex 4.5. Well, I might be the one who missed the information here.

Anyway, that’s Mr Burt for the effort 🙂

PS: I have change the Flex SDK to 4.0 and the example works like charm. the apps is up and running in less than 10 minutes (well, I needed to download the SDK first).

Advertisements
This entry was posted in Closed Issue, Grails Development and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s