Dependency on ANE file

ido.ran's Avatar


08 Aug, 2014 03:36 PM

My project has several ANE dependencies.
When I add a reference to ANE file using dependencies instruction it doesn't seem to work.
How should I do it?

Thank you,

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

    Yennick Trevels's Avatar

    You'll have to use the 'extensionDir' property, where it's value is either an absolute or relative (from the project directory) path to where the ane files are.

    airMobile {
        extensionDir = 'libs/ane_extensions/ 
  2. Support Staff 2 Posted by Yennick Trevels on 09 Aug, 2014 08:12 AM

    Yennick Trevels's Avatar

    Ignore my last answer, that's only when you're building an application, not a library.
    With a library you should just be able to reference those swc-based ane libraries as dependencies

  3. 3 Posted by ido.ran on 09 Aug, 2014 08:35 AM

    ido.ran's Avatar

    I understand and that's the right answer. Unfortunately some developers distribute only the ANE file without the accompany swc file and as it turns out it is possible to reference ANE file using external-library switch.
    One possible workaround is simply to copy the ANE file and rename it to SWC.

    But, maybe adding ane command along side merged, external, etc. can be more elegant solution.

  4. Support Staff 4 Posted by Yennick Trevels on 09 Aug, 2014 08:53 AM

    Yennick Trevels's Avatar

    I think for now the merged, external etc. scopes are sufficient. But as you indicated in your bug report, GradleFx currently only accepts swc-based dependencies, while it might make sense to also accept the '.ane' based files since they're also accepted by the external-library switch of the compiler (which GradleFx uses in the background).
    So I'll just have to fix that bug I guess :)

    I'll think about adding the 'ane' scope, not quite sure whether I want that, although it sounds like it might have some benefits (in terms of usability)

  5. 5 Posted by Matyas on 29 Oct, 2014 01:37 AM

    Matyas's Avatar

    Are you sure that the extensionDir property is working?
    I have this in my build.gradle:

    airMobile {
        platform = 'ios'
        target = 'ipa-debug'
        provisioningProfile = 'buildTools/development.mobileprovision'
        platformSdk = ' ' // BUG workaround: if this is not here the iOS SDK will be set to "null"
        extensionDir = 'anes'

    (the anes directory has some .ANE files) But if I run gradle clean packageMobile the extensionDir property seems to be ignored, this is how mxmlc is invoked:

    Compiling with mxmlc
    [ant:java] Java Result: 39
    :compileFlex FAILED

    This fails because the compiler cannot find classes that are in the ANE. As you can see the path defined in the extensionDir property is not here.. Or is there something else needed?

  6. Support Staff 6 Posted by Yennick Trevels on 31 Oct, 2014 11:51 PM

    Yennick Trevels's Avatar

    You're mixing up two things, the compilation of your project and the packaging of it into a platform specific bundle (in your case an ipa).
    What you're seeing there are the options used during compilation (mxmlc is the application compiler). Since the extensionDir property only applies to the packaging of your application, it won't show up in this compilation options list. There might be another problem during compilation (try to run gradle with either --info or --stacktrace). You probably didn't declare the required ane's as dependencies.

  7. 7 Posted by Peter Nicolai on 05 Dec, 2014 08:20 PM

    Peter Nicolai's Avatar

    "it might make sense to also accept the '.ane' based files since they're also accepted by the external-library switch of the compiler (which GradleFx uses in the background)."

    I agree - gradlefx should support this since the compiler (and IDEs do) - otherwise you end up having to modify your project just to make it compatible with gradlefx which is undesirable IMO.

    It is possible to get a working SWC out of an ANE and use that, but it's unnecessary and creates more risk of version conflicts, an extra artifact to manage versioning of, etc.

  8. Support Staff 8 Posted by Yennick Trevels on 06 Dec, 2014 01:00 AM

    Yennick Trevels's Avatar

    This will be in the next version of GradleFx:

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

14 Jun, 2024 06:20 PM
02 Jun, 2024 07:35 PM
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 Jan, 2021 06:56 PM
09 Mar, 2020 11:11 PM
09 Mar, 2020 11:09 PM