ANE Extension Context null - actionscript-3

I am using FreshPlanet KeyboardSize ANE in my project. I have successfully added to my project but when I run
MeasureKeyboard.getInstance().setKeyboardAdjustNothing();
I get the following error.
ArgumentError: Error #3500: The extension context does not have a method with the name setKeyboardAdjustNothing.
at flash.external::ExtensionContext/_call()
at flash.external::ExtensionContext/call()
at com.freshplanet.ane.KeyboardSize::MeasureKeyboard/setKeyboardAdjustNothing()e
How can I fix this?
Thanks.

Make sure both your Application-app.xml from the src and from your bin-debug folder contain the NAME_OF_THE_EXTENSION_ID tag matching exactly what is being called in your ExtensionContext.createExtensionContext(NAME_OF_THE_EXTENSION_ID,null) inside the source code of the ANE. If they don't match you'll not be able to set the external context in the initialization. That should also match the alias from your RemoteClass descriptor before the class declaration. I hope it's helpful info.

In my case what happened was that MSVCR (Microsoft visual c++ redistribution) was missing which is required to run c++ code.
Because the code in the extension was not able to run, the app could not find any function included in the ANE.
Make sure the code of your ANE is able of running either by writing logs or by running some sample native code independently.

Related

Windows Runtime Component Add As Link With Different Namespace

I have been trying to create background tasks in my universal app solution. As separate Windows Runtime Component project is required to contain background tasks, I have add one to my solution. In the tasks I am accessing a class that resides in my shared project and in order to do so I use add as link. Although there seems to be no errors when I try to compile the project I get the following errors.
"winmdexp.exe" exited with code -1073741819.
Metadata file 'C:\...\BackgroundTasks.winmd' could not be found...
I believe it might be caused by the fact that the classes that I add as link doesn't have the same major namespace as background task project.
Does anyone know a solution to this problem.
Thanks in advance.
As stated in Creating Windows Runtime Components in C# and Visual Basic, all public types must have a root namespace that matches the assembly name. I believe by adding a class as a link to my Windows Runtime Component project, I broke the same root namespace restriction and as the project didn't compile successfully metadata file was not created.
In order to solve this problem at first I changed output type of my project to class library and it compiled without a problem. Unfortunately background tasks didn't run when I tried to trigger them from lifecycle events.
So in the end I moved the classes that was shared between my "Shared" and background tasks project into a class library project and this solved my problem.

C++ Builder - Project x.exe raised exception class ELUInvalidResLibrary with message 'Invalid resource

I'm using C++ Builder 2009 project which I'm trying to internationalize using korzh localizer plugin.
When I run my application and try to Initialize the language menu, I get an Exception of:
Project abc.exe raised exception class ELUInvalidResLibrary with message 'Invalid resource file format "C:\path\to\exe\abc.exe"'.
I find the resource reference to the executable seems a bit goofy. Any ideas?
Progress Update:
I have another project which is translating properly. So I referneced it. I noticed I was missing the abc_klr.res file in the project, so I added it and it got me past that exception on the LocalizerOnFly->Init(), but I get a similar exception when trying to change the language. The difference is the executable is no longer referenced and instead I get a "" as the resource reference... Below is a screen shot:
So my problem was fixed in two steps:
Add the resource file to the project then rebuild.
Clean the project and deploy directory of any translation related
files, then refresh the language files.
Things are groovy again.

mxmlc load-externs is ignored

I develop an ActionScript 3 project using FlashDevelop 4.
I have a main SWF holding all the code.
I want to export some of the main SWF code into modules.
I created a module to hold the separated logic (by extending ModuleBase).
I don't want the module SWF to reference anything that is available in the main SWF so i ran the main SWF compilation with -link-report and got a report.xml file holding all the main SWF references.
I tried to compile the module (mxmlc) while excluding any class or library in the main SWF using the load-externs=report.xml option.
The compilation gave me an error saying that some libraries references are missing, but the error message referenced classes that are suppose to be included only in the main SWF.
I checked the report.xml file and it does show that these classes are referenced.
I tried to run the compilation in 3 different ways and always got the same result:
Using the build current file in FlashDevelope and giving the file a header of the command that should be ran.
Using command line (windows).
Using Ant build script.
Does anyone have any idea why this could happen?
I would be happy to supply more information about my problem if it helps anyone guide me to a solution.
Thanks for the help!
It turns out that it did not ignore the load-externs.
The load-externs excluded some of the libraries and therefor these libraries were not found during compile time.
I solved the problem by adding the libraries path to the compilation.
This was done by addind the flag: -l+=lib\

Getting Type not found error implementing source in as3

I am trying to just compile and run the demos from this article:
Flash talks to max msp via osc
I am using Flash Develop and Flex SDK with an up to date version of air.
When I run the demo: "as3_MaxFlashHarmony" I get an error I don't know how to fix. The source for the entire project is here:
the project
But specifically the error I am getting says:
col: 30 Error: Type was not found or was not a compile-time constant: OSCMessage.
here is the as3 file that it is specifically referencing:
//IHarmonyApp.as
package
{
import org.tuio.osc.OSCMessage;
public interface IHarmonyApp
{
function updateOSCData(msg:OSCMessage):void;
}
}
It uses the libraries Tuio, MinimalComps, and MonsterDebugger. The thing I don't get is that how can it not find OSCMessage if OSCMessage is properly imported? the IDE is making fine references to it and I can open it's declaration. OSCMessage is a public class. I don't get it.
To give some extra info for potential answers, the IDE flashdevelop can find the library org.tuio.osc.OSCMessage just fine, it gives the error regardless of if org.tuio... is a source path or not, and the overall path does not contain any special characters. I don't know if that might matter, but I feel like this is me making a stupid mistake somewhere. I can provide my project zipped if need be.
Thanks!
Edit 9:48, 8/25/12
I do have the file path org/tuio/osc/OSCMessage.as in my project, and the file OSCMessage exists. FlashDevelop can find it just fine and I can navigate to declaration at that location. This is why I got stumped.
Thanks again
In your AS3 folder apart of your de folder you would need to have org folder with relevant folders and classes.
For example to import org.tuio.osc.OSCMessage you would need a file:
../YourPackageRoot/org/tuio/osc/OSCMessage.as
The other way is including a SWC file (all folders and classes zipped into one swc file).
You can include the swc file in FlashDevelop by right clicking the swc file and selecting Add To Library

VerifyError: Error #1014: class could not be found

I'm developing AS3 project using Flash Builder 4.5 (also with library Away3D 4.0 and Flex 4.5.1 SDK).
Also, I add my own SWC library, which I compile previously into my project.
It works find if I import class in my SWC library, however I want my swf run in a stand-alone flash player 11.
I follow this tutorial:
http://help.adobe.com/en_US/flashbuilder/using/WSe4e4b720da9dedb5-4dd43be212e8f90c222-7ffb.html
Now, I could run my app in a flash player 11, but I got an error in run time:
VerifyError: Error #1014: XXX class could not be found
And XXX is my class in SWC library. How should I fix this?
Merged into code means this, in project properties -> Flex Build Path -> Library Path -> Framework Linkage. Framework lingage has two options Merged into code and RSL. Chose Merged into code. This should solve your problem.
We had this problem when trying to build a project using a Native Extension.
Classes within the NE weren't being found at runtime, but were accessible in Flash Builder.
It turned out that by default the .ANE file wasn't copied to the device.
To fix this, change the following project property:
ActionScript Build Packaging -> Apple iOS -> Native Extensions -> Check 'Package' for the ANE
No idea why it wasn't included by default. When you uncheck 'Package' you get a warning telling you that it may cause runtime issues!
In my case, we had a nested reference to the same library which needed to load before the other library also using it. This fix can be accomplished by unchecking the 'Automatically determine library ordering based on dependencies' and moving the library up in the chain of Build path libraries. Flash Builder was unable to determine the correct order base on dependencies because we had 2 different versions of the same library. The error would only happen during run time.
I had this problem after installing AIR 3.9 and trying to upgrade a project.
It was also saying there was an RSL error, before throwing a succession of #1014 errors.
It worked after I set the textLayout.swc link type in Advanced ActionScript Settings to 'merged into code' instead of the default (RSL)
Hope this helps!
Since I landed on this page searching for this error message and none of the above solutions worked for me, here's how I finally managed to work around it:
It seems that this error happens particularly when you include old libraries that were compiled with the old compiler but compile your app with the new one. Unfortunately the error sometimes fires and when you compile again it doesn't; at other times it works fine in the debug version but then it fails in the release.
What worked for me is to include dummy objects in your main app which are instances of the class that the verify error complains about:
import some.classpath.to.TheClassThatFailsOnVerify;
function YourMainApp(){
var dummy:TheClassThatFailsOnVerify = new TheClassThatFailsOnVerify ();
}
At least in my case the errors only fired for classes that were not used directly in the app but only internally in the swc library code, so by having the dummy objects in the main app I force Flash Builder to include those classes in the compilation.
In some cases you might have to first find the swc that contains the class in question since it's not part of the library swc you use but it's again a library that that swc uses itself.