How to add AIR framework libraries?

ido.ran's Avatar


09 Aug, 2014 07:43 AM

I'm build AIR library and application (not Flex).
My library project has reference to those external-libraries:

And when I run gradle compileFlex -debug I see it is referring to those external-libraies:
'-external-library-path+=/Applications/Apache Flex/Flex4.12.1_AIR13.0/frameworks/libs/framework.swc'
'-external-library-path+=/Applications/Apache Flex/Flex4.12.1_AIR13.0/frameworks/libs/textLayout.swc'
'-external-library-path+=/Applications/Apache Flex/Flex4.12.1_AIR13.0/frameworks/libs/spark.swc'
'-external-library-path+=/Applications/Apache Flex/Flex4.12.1_AIR13.0/frameworks/libs/sparkskins.swc'
'-external-library-path+=/Applications/Apache Flex/Flex4.12.1_AIR13.0/frameworks/libs/rpc.swc'
'-external-library-path+=/Applications/Apache Flex/Flex4.12.1_AIR13.0/frameworks/libs/charts.swc'
'-external-library-path+=/Applications/Apache Flex/Flex4.12.1_AIR13.0/frameworks/libs/spark_dmv.swc'
'-external-library-path+=/Applications/Apache Flex/Flex4.12.1_AIR13.0/frameworks/libs/OSMF.swc'
'-external-library-path+=/Applications/Apache Flex/Flex4.12.1_AIR13.0/frameworks/libs/mx/mx.swc'
'-external-library-path+=/Applications/Apache Flex/Flex4.12.1_AIR13.0/frameworks/libs/advancedgrids.swc'

How can I ask GradleFX to use AIR framework and not Flex framework? I still want to build swc file for AIR library.

  1. Support Staff 1 Posted by Yennick Trevels on 09 Aug, 2014 08:17 AM

    Yennick Trevels's Avatar

    Have you set the 'frameworkLinkage' property to 'none'?

    like this:

    frameworkLinkage = 'none'
  2. 2 Posted by ido.ran on 09 Aug, 2014 08:47 AM

    ido.ran's Avatar

    That will remove the references to flex framework but I still need to add references to AIR libraries as I wrote in my first question.
    Is there a way to add frameworkLinkage for air?

    It is not blocking, I've use none and I'm referencing the specific libraries I need but it will make the life a bit easier.

    Thank you.

  3. Support Staff 3 Posted by Yennick Trevels on 09 Aug, 2014 09:05 AM

    Yennick Trevels's Avatar

    Oh ok, I thought you figured that one out but where just having an issue with the Flex libraries that showed up :)

    The thing is that, when using Flex, you get those libraries "for free" since it'll use one of the *-config.xml files provided with the SDK. But since you're not using Flex it won't use those files and you'll have to manually declare them as dependencies.

    Just make sure you don't reference the AIR libraries with the absolute path, but by referencing them relatively from the Flex home directory like this:

    dependencies {
        merged files("${flexHome}/frameworks/libs/air/airglobal.swc ")
  4. 4 Posted by ido.ran on 09 Aug, 2014 09:08 AM

    ido.ran's Avatar

    I see, thank you - I'll do that.

  5. Support Staff 5 Posted by Maxime Cowez on 10 Aug, 2014 12:23 PM

    Maxime Cowez's Avatar

    It looks like you're using a full blown Flex SDK. You might as well use a standalone AIR SDK instead (using the airSDK dependency; see, since it comes with mxmlc and compc which are the tools that GradleFx requires to build your application.

    The AIR SDK has a custom version of `flex-config.xml' that only references those libraries required for AIR apps.

    If you're not using auto-install (or perhaps if auto-install doesn't work for a standalone AIR SDK; should ask @Yennick, I'm not sure about that), you'll have to modify flexHome to point to the AIR SDK instead of the Flex SDK you're currently using.

  6. 6 Posted by ido.ran on 10 Aug, 2014 02:42 PM

    ido.ran's Avatar

    using airSDK in sdk_auto_install will only download the SDK for me.
    I still need to use a frameworkLinkage to decide which SDK to use?
    I think the problem is that today AIR and Flex SDK are intermingled.
    Another thing is that I use AIR SDK and not Flex SDK.

    I've successfully build my library by referencing only the files I listed above.

  7. Support Staff 7 Posted by Yennick Trevels on 11 Aug, 2014 07:13 AM

    Yennick Trevels's Avatar

    @Maxim: If I remember right, you can specify the AIR SDK dependency without the Flex SDK dependency. Both auto-installs should set the flexHome property, so I think it should work.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

07 May, 2023 04:17 PM
28 Apr, 2023 11:22 PM
23 Apr, 2023 09:43 AM
03 Nov, 2022 01:22 AM
29 Jun, 2022 05:39 PM


04 Aug, 2021 12:50 PM
15 Apr, 2021 06:10 PM
15 Jan, 2021 06:56 PM
09 Mar, 2020 11:11 PM
09 Mar, 2020 11:09 PM
17 Apr, 2019 02:51 PM