Error message

Error: Type was not found or was not a compile-time constant: YourNativeExtension


You would usually get this error message at compile-time, when your code references something in a library that the compiler doesn’t know where to find. In the case of using a native extension, this means that your project’s SWF file was built without the native extension (ANE).


Make sure the .ane file of the native extension is included in your project – see the examples below for ways to do it.


1. On the command line

Add the path to your native extension with the -external-library-path option when you run MXMLC to compile your project:

mxmlc +configname=YourProjectName 
      -output path/to/YourAppName.swf ProjectMainFile.mxml 

2. In Flash Builder

Select Project > Properties > Flex Build Path > Native Extensions > Add ANE… and add the native extension’s .ane file to your project:

Select Project > Properties > Flex Build Packaging to add an ANE to your project

About the Author

Radoslava is co-founder of DiaDraw. Prefers to communicate with images. Verbal communication always caused trouble with her parents. Started speaking Basic early on, followed by four years of Delphi, six years of C++, four years of ActionScript, lately converses in Objective-C. Her mum and dad hope she'll start speaking human at some point.