Flex – uses Ant MXMLC tasks with native extensions

I have an AIR application and I am compiling for mobile. There is an iOS native extension (JamPot MobileBackup) that compiles well when used in an IDE.

< p>However, the IDE is not enough to support other platforms now, I decided to build an Ant script to run the build process.

The problem is that this particular ANE seems to define the MobileBackup class in the extension code instead of something like The other ANE I am using is defined in a separate .as file.

This is the error I see:

[mxmlc] Loading configuration file /Users/anderson/src/flex/4.6.0/frameworks/airmobile-config.xml
[mxmlc] /Users/anderson/src/xxx/src/xxx/Utility.as(32): col: 35 Error: Type was not found or was not a compile-time constant: MobileBackup.
[mxmlc]
[mxmlc] private static var mobileBackup:MobileBackup = new MobileBackup();
[mxmlc ] ^
[mxmlc]
[mxmlc] /Users/anderson/src/xxx/src/xxx/Utility.as(32): col: 54 Error: Call to a possibly undefined method MobileBackup.< br />[mxmlc]
[mxmlc] private static var mobileBackup:MobileBackup = new MobileBackup();
[mxmlc] ^
[mxmlc]
[mxml c] /Users/anderson/src/xxx/src/xxx/Utility.as(32): col: 54 Error: Call to a possibly undefined method MobileBackup.
[mxmlc]
[mxmlc] private static var mobileBackup:MobileBackup = new MobileBackup();
[mxmlc] ^
[mxmlc]
[mxmlc] /Users/anderson/src/xxx/src/xxx/Utility.as( 21): col: 35 Error: Definition ie.jampot.nativeExtensions:MobileBackup could not be found.
[mxmlc]
[mxmlc] import ie.jampot.nativeExtensions.MobileBackup;

The mxmlc call is as follows:

 file="${app.main.class.file}" 
output="${ build.output.swf.file}"
locale="${LOCALE}"
static-rsls="false"
accessible="false"
configname="airmobile"
debug="${build.debug.mode}"
failonerror="true"
fork="true"
maxmemory="512m">
















where app.ane.path is the project’s .ane file The path of the collection.

I also tried to use library-path instead of external-library-path.

Apart from adding build.xml, I did not change the Flash Builder project at all Layout or content, it can still be compiled in the IDE.

What do I need to do to compile outside of the IDE?

I got it all done, and decided to try again before publishing. I think It works, so I will post the results of others here.

Flash Builder must pull the SWC out of the ANE for mxmlc to use. I found a copy of the SWC elsewhere, and Add it to my libs folder, hey presto, it works.

I have an AIR application and I am compiling mobile. There is an iOS native The extension (JamPot MobileBackup), when used in the IDE, compiles well.

However, the IDE is not enough to support other platforms now, I decided to build an Ant script to run the build process.

The problem is that this particular ANE seems to have the MobileBackup class defined in the extension code, rather than in a separate .as file like the other ANEs I am using.

This is what I see Error received:

[mxmlc] Loading configuration file /Users/anderson/src/flex/4.6.0/frameworks/airmobile-config.xml
[mxmlc ] /Users/anderson/src/xxx/src/xxx/Utility.as(32): col: 35 Error: Type was not found or was not a compile-time constant: MobileBackup.
[mxmlc]
[mxmlc] private static var mobileBackup:MobileBackup = new MobileBackup();
[mxmlc] ^
[mxmlc]
[mxmlc] /Users/anderson/src/xxx/src/ xxx/Utility.as(32): col: 54 Error: Call to a possibly undefined method MobileBackup.
[mxmlc]
[mxmlc] private static var mobileBackup:MobileBackup = new MobileBackup();
[mxmlc] ^
[mxmlc]
[mxmlc] /Users/anderson /src/xxx/src/xxx/Utility.as(32): col: 54 Error: Call to a possibly undefined method MobileBackup.
[mxmlc]
[mxmlc] private static var mobileBackup:MobileBackup = new MobileBackup();
[mxmlc] ^
[mxmlc]
[mxmlc] /Users/anderson/src/xxx/src/xxx/Utility.as(21): col: 35 Error: Definition ie.jampot.nativeExtensions:MobileBackup could not be found.
[mxmlc]
[mxmlc] import ie.jampot.nativeExtensions.MobileBackup;

The mxmlc call is as follows :

 file="${app.main.class.file}" 
output="${build.output.swf. file}"
locale="${LOCALE}"
static-rsls="false"
accessible="false"
configname="airmobile"
debug= "${build.de bug.mode}"
failonerror="true"
fork="true"
maxmemory="512m">










where app.ane.path is the path of the project’s .ane file collection.

I also tried to use library-path instead of external-library-path.

Apart from adding build.xml, I did not change the layout or content of the Flash Builder project at all, and it can still be compiled in the IDE.

What do I need to compile outside of the IDE?

I got it all done and decided to try it again before publishing. I figured it out, so I will post others here Results.

Flash Builder must pull the SWC out of the ANE for mxmlc to use. I found a copy of the SWC elsewhere and added it to my libs folder, hey presto, how it works.

Leave a Comment

Your email address will not be published.