Skip navigation
squidbot
Currently Being Moderated

Is there any way to export a desktop AIR package when desktop is not supported by an ANE?

Nov 30, 2012 11:42 AM

I have a third party ANE that I need to use. The ANE has a target for Android, but when I add it in Build Path->Native Extensions an error shows up "This ANE does not support Desktop(Mac) platform". Now, my app is targeting android, but to make it easy for others in my company to play builds without having a device, I've been using the "Export Release Build->Signed AIR package for installation on desktop" option. The problem is, since I've added the ANE, I'm no longer able to hit the "finish" button because it's greyed out due to the error (even though the checkbox to include the ANE is unchecked in the export settings. The only way I've found to work around this is to remove the ANE temporarily and comment out references to it to build the desktop package, which is not optimal. Any other suggestions?

Thanks!

 
Replies
  • Currently Being Moderated
    Nov 30, 2012 12:24 PM   in reply to squidbot

    Rather than commenting it out, you could define a compiler parmeter:

    [code]

      -define=CONFIG::includeAndroidANE,true

    [/code]

    Then, in your code, wrap any references to the problem code in the config statement

    [code]


    CONFIG::includeAndroidANE

    {


    import the.problem.package.ProblemExtensionClass;

    }

    [/code]

    And:

    [code]

    CONFIG::includeAndroidANE

    {

       if(ProblemExtensionClass.isSupported()) {

            var v:ProblemExtensionClass = new ProblemExtensionClass();

             v.init();

             v.doSomethingThatIsntSupportedOnAMac();

       }

    }

    [/code]

     

    Then, when you compile for Mac, you just need to set CONFIG::includeAndroidANE,false;

     

    This is what OSMF does to support different versions of the player, and also what SWIZ do to support different versions of Flex.

     

    All good.

    G

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points