Hi, Reading some blogs on the topic, it seems that there is another approach to using ANE, than including the ANE file directly:
Instead of referencing the ANE in the app descriptor, you can package your ANE is a separate SWC, using ADT, that has its own deployment descriptor. In that descriptor, you can say which file/class is used on which platform, so you can set it to use a fake class on Desktop. Example: adt -package -target ane myextension.ane extension.xml -swc mySwc.swc -platform iPhone-ARM library.swf libmylib.a -platformoptions myplatformoptions.xml OR: adt -package -target ane Output.ane extension.xml -swc VolumeLib.swc -platform iPhone-ARM -C ios . -platformoptions platformoptions.xml -platform Android-ARM -C android . -platform default -C default http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt5.html The sample mobile demo "FlexGame" uses this approach: http://www.adobe.com/devnet/flex/samples/game-of-flex-on-tablets.html (source is available in the page). Note: I didn't try what is described in these linkes, so sorry if it doesn't work. HTH. Maurice -----Message d'origine----- De : Alex Harui [mailto:[email protected]] Envoyé : mardi 26 novembre 2013 18:42 À : [email protected] Objet : Re: How to avoid native extension execution? Hmm. It may be difficult to get FB to agree to let you do this. I generally use FDB for debugging so I just made a copy of the -app.xml to a new name and launched using that copy of the -app.xml by calling adl directly. If you need to use the FB debugger, there is a trick about setting up a custom debug config that doesn't launch anything, then you start the app by hand. Om described it in a recent post. I've never used it myself. For sure, though, your code must also handle not having the native extension. -Alex On 11/26/13 12:35 AM, "Deepak MS" <[email protected]> wrote: >I removed extensions node, cleaned up the project and made sure that >bin-debug folder's -app.xml file too was without 'extensions' node in >it and then ran the app as a desktop application and I got this error >message: > >An internal error occurred during: "Launching JJP_Sales_Insight_zip". >java.lang.NullPointerException > >No further details. > >Next time again if i try to run the app, this time it automatically >inserts the extensions node in bin-debug's -app.xml and I end up >getting 'could not load extension' error. I am using FB 4.6. > > > >On Tue, Nov 26, 2013 at 1:12 PM, Alex Harui <[email protected]> wrote: > >> >> >> On 11/25/13 11:04 PM, "Deepak MS" <[email protected]> wrote: >> >> >Ok. So if I need to have 2 separate app.xml files, then I think I >>should >> >be >> >removing 'extensions' node from xml file right? If so, I did try >>running >> >the app on desktop after removing that node, but still I get the >> >same error. Or is there something else I have to do in xml file to >> >make it work? >> I have definitely had success emptying out the extensions node in the >> -app.xml file in order to keep a native extension from loading. I'm >> wondering if the wrong -app.xml file is being used or it is cached >> somewhere. Remember that it is re-generated on every build from a >> template. >> >> > >> > >> >On Tue, Nov 26, 2013 at 12:06 PM, Alex Harui <[email protected]> wrote: >> > >> >> You might be able to set up a custom run/debug configuration that >>picks >> >>a >> >> different -app.xml file. >> >> >> >> On 11/25/13 9:57 PM, "Deepak MS" <[email protected]> wrote: >> >> >> >> >Hi there, >> >> >I'm using a native extension for one of my iPad app, which takes >>care >> >>of >> >> >unzipping large files on the device. Whenever there are any code >> >>changes >> >> >in >> >> >the app, I always have to test it on the device, as I cannot run >> >> >the >> >>app >> >> >on >> >> >windows AIR simulator when I am using native extension. I get >> >> >this >> >>error >> >> >message if I try to run it on desktop: >> >> > >> >> >"Process terminated unexpectedly. >> >> > >> >> >The content cannot be loaded because there was a problem loading >> >> >an >> >> >extension: Error: Requested extension com.xyz.ane.ANEZip is not >> >>supported >> >> >for Windows-x86." >> >> > >> >> >It really takes lot of time to test it out on the device each and >>every >> >> >time when changes are done in the app. >> >> > >> >> >So I wanted to know if there is a way we can avoid native >> >> >extension >> >>from >> >> >getting executed, while we want to test it on desktop? >> >> > >> >> >Right now I have created 2 projects! One with native extension >> >> >and >> >>another >> >> >without native extension to test on desktop. I know for sure, >> >> >this >> >>isn't >> >> >the right way. >> >> >> >> >> >>
