Select to view content in your preferred language

Flex Viewer doesn't compile with FlashDevelop / Flex SDK

1841
4
01-04-2011 05:12 AM
abcdefghij
Deactivated User
Hello together.

For my Flex development work, I use the latest version of the FlashDevelop IDE, which is based on the open source Flex SDK (version 4.1.0). Now I have problems with compiling the ArcGIS Flex Viewer 2.2 application using this environment. I managed to fix a few errors which I was notified about by the compiler (missing library path, missing leading "/" in asset file paths). Now, I don't get any further error messages, but the project still fails to build.

So, my question is, is there anyone who has successfully compiled Flex Viewer 2.2 (or 2.1, same problem there) using the FlashDevelop/Flex SDK environment and could tell me how to do it?

With best regards,

Seb
Tags (2)
0 Kudos
4 Replies
JonFisher
Emerging Contributor
Hello together.

For my Flex development work, I use the latest version of the FlashDevelop IDE, which is based on the open source Flex SDK (version 4.1.0). Now I have problems with compiling the ArcGIS Flex Viewer 2.2 application using this environment. I managed to fix a few errors which I was notified about by the compiler (missing library path, missing leading "/" in asset file paths). Now, I don't get any further error messages, but the project still fails to build.

So, my question is, is there anyone who has successfully compiled Flex Viewer 2.2 (or 2.1, same problem there) using the FlashDevelop/Flex SDK environment and could tell me how to do it?

With best regards,

Seb



Have you tried Project | Clean ?
0 Kudos
abcdefghij
Deactivated User
Hello, and thank you for you reply.

However,

Have you tried Project | Clean ?


I can't find any button / menu entry to "clean a project" in FlashDevelop. To make this more clear, I'm not talking about Adobe Flash Builder. FlashDevelop is a free (open source) and much less resource-hungry replacement which works really fine for me, except for compiling the Flex Viewer sources...
0 Kudos
abcdefghij
Deactivated User
The problem is solved.

Here is what was going on:

For some reason, mxmlc (the compiler that comes with the free Flex SDK) requires paths for embedded assets to begin with a "/". For example, here is a line from the Flex Viewer's "src/default.css" file:

downArrowUpSkin: Embed(source="assets/images/arrow_down.png");

This will cause a compilation error with mxmlc. To make it work, you have to add a leading "/" to the file path:

downArrowUpSkin: Embed(source="/assets/images/arrow_down.png");


There are many of such lines in the Flex Viewer sources, and if all of them are modified as described here, mxmlc will compile the project successfully.

Now, for some reason, FlashDevelop displays only a small subset of all compiler errors which are caused by this problem. I fixed all faulty lines which FlashDevelop told me about, until no further error messages showed up. Still, the project didn't compile, with FlashDevelop providing no further explaination.

Finally, I had the idea to manually call mxmlc with the required arguments from the command line, and voilà, it spat out a bunch of more missing-slash-related error messages. I fixed them, and now it works.

Still, I'd be glad if someone could perhaps tell me a better solution to this problem. Having to change the sources of all projects which seem to be sort of "not built for mxmlc" is a bit ugly. Furthermore, on Linux and other Unix derivates, a leading slash normally indicates an *absolute* path. In other words, the way how mxmlc seems to resolve paths doesn't conform to a most elementary convention under these operating systems, which is extremely irritating.
0 Kudos
EdSaunders
Regular Contributor
geoseb, thanks for posting this, solved my issues.

Cheers.
0 Kudos