Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Cannot load application containing ane

Can you create an ANE that pretty much does nothing? This would isolate the issue being a setup issue vs. an ANE issue.
Trusted Contributor
cjonesy
Posts: 160
Registered: ‎09-13-2012
My Device: 9900

Re: Cannot load application containing ane

I am not fully understanding you - i'm thinking im already pretty much having the ane as basic as it can be?

 

The native code is from http://supportforums.blackberry.com/t5/Adobe-AIR-Development/Creating-AIR-Native-Extensions-for-BB10... (just copy and paste ) and this is my as3 code

 

package com.example
{
	
	import flash.external.ExtensionContext;
	 
	public class TestANE
	{ 
		private var _ctx:ExtensionContext;
		
		public function TestANE()
		{
			this._ctx = ExtensionContext.createExtensionContext( 
				"com.example.NativeCode", null);
			
		}
		public function sayHello( ): Object {
			var result:Object = this._ctx.call( "sayHello" );
			return result; 
		}
	}
}

 

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Cannot load application containing ane

In your original post, you have a different ID from what is shown in the AS3 code. They need to be the same.
Trusted Contributor
cjonesy
Posts: 160
Registered: ‎09-13-2012
My Device: 9900

Re: Cannot load application containing ane

Very confused now..

 

there is..

name of the package created in air, (com.example.TestANE),

 

the argument in createExtensionContext("com.example.NativeCode", null)

the name of native extension in momentics (<id>com.example.NativeCode</id>)

 

When i add the extensions tag my understanding is it links to the com.example.TestANE package created earlier in air, neither of them work anyway. Tried them both.

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Cannot load application containing ane

All the IDs need to be the same. I would reset them, rebuild the ANE (that uses the SWC), check the XML file, and rebuild the using app.
Trusted Contributor
cjonesy
Posts: 160
Registered: ‎09-13-2012
My Device: 9900

Re: Cannot load application containing ane

I'm 99% sure it's not a naming issue like that - i have created many different projects following the tutorial very closely each time.

 

I have just created a Native extension project in momentics calling it TestANE with <id>com.example.TestANE</id>, I don't use the code from the site this time - i use the template which has sayHello as well.

 

I build this linking to the .swc/flex library project which..

 

has a class TestAne in package com.example and which calls 

ExtensionContext.createExtensionContext( com.example.TestANE", null);

 

I then add the exported ane to my project using add swc option (because its fb 4.5.1) as stated using external as the option. The xml contains 

<extensions>
<extensionID>com.example.TestANE</extensionID>
</extensions>

 

All are now using com.example.TestANE but same problem occurs.

 

I'm clueless as to what to do.

 

 

Retired
dmalik
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook

Re: Cannot load application containing ane

You need Flash Builder 4.6 to use ANE's. 4.6 is a free upgrade. 

 

Check out this article - http://www.adobe.com/devnet/flash-builder/articles/whatsnew-flashbuilder-46.html 

 

Regards,
Dustin

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
Trusted Contributor
cjonesy
Posts: 160
Registered: ‎09-13-2012
My Device: 9900

Re: Cannot load application containing ane

Thanks for the clarification.