Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
Rather than commenting it out, you could define a compiler parmeter:
-define=CONFIG::includeAndroidANE,true
Then, in your code, wrap any references to the problem code in the config statement
CONFIG::includeAndroidANE | ||
{ | ||
import the.problem.package.ProblemExtensionClass; | ||
} |
And:
CONFIG::includeAndroidANE
{
if(ProblemExtensionClass.isSupported()) {
var v:ProblemExtensionClass = new ProblemExtensionClass();
v.init();
v.doSomethingThatIsntSupportedOnAMac();
}
}
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
Copy link to clipboard
Copied
Ah thanks! I didn't realize just commenting out the imports would allow it to export the build without removing the ANE. Worked like a charm!