The problem with ANE is that this is not a complete implementation. Most importantly, ANE does not implement a realistic backup implementation by default, namely that the device will back off if there is no specific implementation for the current platform.
This makes ANE very difficult in cross-platform development, as in some cases this will fail. Any platform that is not specifically enabled will fail with the message you received.
Basically, without changing the ANE, you cannot use it as you expect. Your only way is to do some compilation of the conditional style and not call ANE in the simulator.
If you want to change ANE, the best option is to implement the default library. It's pretty simple, but you'll need: Xcode, eclipse with Android dev tools and adt from the AIR SDK.
First, you will need to compile existing projects, the Android library, iOS and the existing actionscript library to generate VibrationAndroidLibrary.jar, libVibrationiOSLibrary.a and VibrationActionScriptLibrary.swc respectively.
Then you need to make another actionscript library and duplicate the com.adobe.nativeExtensions.Vibration class, as shown below:
public class Vibration { public function Vibration() { } public static function get isSupported():Boolean { return false; } public function vibrate(duration:Number):void { } }
This class will replace another class in cases where the extension will not be implemented instead of receiving the above message.
Then we need to add the default definition to the extension.xml file:
<extension xmlns="http://ns.adobe.com/air/extension/2.5"> <id>com.adobe.Vibration</id> <versionNumber>1</versionNumber> <platforms> <platform name="Android-ARM"> <applicationDeployment> <nativeLibrary>VibrationAndroidLibrary.jar</nativeLibrary> <initializer>air.extensions.VibrationExtension</initializer> <finalizer>air.extensions.VibrationExtension</finalizer> </applicationDeployment> </platform> <platform name="iPhone-ARM"> <applicationDeployment> <nativeLibrary>libVibrationiOSLibrary.a</nativeLibrary> <initializer>ExtInitializer</initializer> <finalizer>ExtFinalizer</finalizer> </applicationDeployment> </platform> <platform name="default"> <applicationDeployment /> </platform> </platforms> </extension>
Then we will need to recompile ANE using the new default actionscript SWC file. Suppose you are in the VibrationNEDeliverables directory from the mentioned ANE, you can enter it in a bash file and run it or put everything on one line from the command line). The first two lines simply extract the library.swf file and move it to the places needed by the package command. Be careful with paths, etc. Here, I suggested that you put the default library in the VibrationActionScriptDefaultLibrary, but you will need to modify it accordingly.
unzip -o -d VibrationActionScriptLibrary/bin VibrationActionScriptLibrary/bin/VibrationActionScriptLibrary.swc unzip -o -d VibrationActionScriptDefaultLibrary/bin VibrationActionScriptDefaultLibrary/bin/VibrationActionScriptDefaultLibrary.swc cp VibrationActionScriptLibrary/bin/library.swf VibrationiOSLibrary/build/Release-iphoneos/. cp VibrationActionScriptLibrary/bin/library.swf VibrationAndroidLibrary/bin/. adt -package \ -storetype pkcs12 -keystore YOUR_SIGNING_KEY.p12 -storepass KEY_PASSWORD \ -target ane com.adobe.extensions.Vibration.ane VibrationActionScriptLibrary/src/extension.xml \ -swc VibrationActionScriptLibrary/bin/VibrationActionScriptLibrary.swc \ -platform iPhone-ARM -C VibrationiOSLibrary/build/Release-iphoneos . \ -platform Android-ARM -C VibrationAndroidLibrary/bin . \ -platform default -C VibrationActionScriptDefaultLibrary/bin .
After that, you should now have a new version of ANE with a default library, which will make it much more accessible! Personally, I do not think that ANE should be released without it.
If you need a fully functional ANE, you can check ours: http://distriqt.com/native-extensions