Installing a native extension in Flash Develop 4 on a Windows Desktop project is a pain in the ass, and the worst part is that the best tutorial you can get searching in google about this is incomplete and innacurate. I have a lot of experience working with native extensions so I decided to create my own tutorials on how to install them for Windows and for Mobile projects.
For a Windows and Mobile app:
1) Create a folder named “lib” in your root Flash Develop project and copy the .ane file into the lib folder created.
2) Without leaving the lib folder make a second copy of the .ane file, rename it with .zip extension, unzip it and then delete the zip (You must end up with an .ane file and a folder with the contents of the .ane file).
3) Inside the unziped folder open the following file: META-INF\ANE\extension.xml
4) Copy the content of the <id> tag, for example: “com.myBuisness.myApp.air.SuperLibrary”
5) Rename the unzipped folder with the tag content we copied before and add the .ane extension to it like it was a file and not a folder, so the folder name must be something like this: “com.myBuisness.myApp.air.SuperLibrary.ane”
6) Go to Flash Develop and do right click on the ane file and then click on “add to library”
7) The Air project was created with some .bat files, you must modify them like this:
Packager.bat: replace the line that starts with “call adt” for:
call adt -package %OPTIONS% %SIGNING_OPTIONS% -target native %AIR_TARGET% %APP_XML% %FILE_OR_DIR% -extdir lib/
Run.bat: replace the line that starts with “adl “%APP_XML%” for:
adl “%APP_XML%” “%APP_DIR%” -extdir lib/
PackageApp.bat: only if your target is Windows replace the line “set AIR_TARGET=” for:
8) Add the following to the application.xml:
9) Where it says PASTE HERE you must paste the content of the tag you copied in the step 4, so must look like this: <extensionID>com.myBuisness.myApp.air.SuperLibrary</extensionID>
10) If your target is Windows, without leaving application.xml modify (or add if doens’t exist) the supportedProfiles tag with only extendedDesktop value like this:
Only extendedDesktop alone is supported, “extendedDesktop Desktop” doesn’t work.
And thats it, the painfull process is finished, the extension must work and when you execute PackageApp.bat you get a .exe, .apk or .ipa file with the native extension working. .air files cannot be created when using native extensions.
On Android target you must create a captative runtime version with the option 3 of the PackageApp.bat menu.
The other tutorials dind’t help very much to create the .exe file or where to get the ID of the app to rename the folder, so this is the best one for the moment.