Dependency on ANE file

ido.ran's Avatar

ido.ran

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,
Ido.

  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
            +configname=airmobile
            -source-path+=C:\CODE\client\src\main\actionscript
            -library-path+=C:\CODE\client\libs\as3-signals-v0.8.swc
            -library-path+=C:\CODE\client\libs\console-2.6.swc
            -define+=CONFIG::DEBUG,true
            -debug=true
            -keep-as3-metadata+=Inject,Embed,ChangeEvent,NonCommittingChangeEvent,PreDestroy,Bindable
            -output=C:\CODE\client\build\client.swf
            C:\CODE\client\src\main\actionscript\com\test\Game.as
    [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: https://github.com/GradleFx/GradleFx/issues/140

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

Generic

? 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

24 Mar, 2017 07:10 PM
19 Mar, 2017 04:39 AM
22 Jan, 2017 07:46 AM
11 Oct, 2016 01:18 PM
20 Sep, 2016 04:36 PM

 

06 Sep, 2016 08:05 PM
03 Aug, 2016 11:15 AM
01 Jun, 2016 05:20 PM
03 May, 2016 09:17 PM
07 Apr, 2016 07:43 AM
24 Mar, 2016 05:55 PM