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

Debug ANE?

Has anyone been able to debug an ANE and if so, the steps involved?

I am getting an exception at

 

this.ext = ExtensionContext.createExtensionContext( 'my_unique_id', null );

 

The ANE is properly packaged and I can see it in the final BAR file.  The IDs match as the id in the extension.xml file in the C++ project.

Developer
Developer
mdd
Posts: 225
Registered: ‎01-17-2012
My Device: PB

Re: Debug ANE?

If it crashes there, its not finding the ANE:

 

check the app.xml <extensions> FB "fixes" it...

 

BTW: installed new OS and simulator (2.1.0.560) and my ANE now is working on simulator, but NOT on PB.

 

Regards,

Developer
Innovatology
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course

Re: Debug ANE?

You can attach to a running process from NDK, which allows you to stop at breakpoints, step through code, inspect variables etc.

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Debug ANE?

<extensions> in the app.xml has the correct ID. Any other thoughts?
Developer
Developer
mdd
Posts: 225
Registered: ‎01-17-2012
My Device: PB

Re: Debug ANE?

the whole ane naming is confused - here's what I found:

 

the ane file will be called e.g. com.example.ane (depending on the Base filename setting in Export)

not:

   <project>.ane as might be expected

and you need to edit extension.xml and set the ID - IDE does not seem to update...

 

but, that has nothing much to do with the ID.  That is called e.g. com.example.NativeAS3

 

also check bb-tablet.xml - make sure it has:

   <action system="true">run_air_native</action>

I went round about many times before getting it straight.

 

oh yes: make sure to Export from NDK after any changes to the AS3 side, at least if the ANE SWC is affected.

 

Now, I've un/re-installed the NDK to see if it changes anything.  It has all the same bugs as originally, even though I deleted the workspace - including the SDK set to 4.6 (I suspect eclipse saved some settings).

 

I was able to connect the NDK to a running app (on PB and simulator) - on PB, it compalined about a shared lib at the wrong address???

 

more later...

 

 

Developer
Developer
mdd
Posts: 225
Registered: ‎01-17-2012
My Device: PB

Re: Debug ANE?

first the good news:

   reinstall of NDK seems to have fixed the ANE.  It works on both PB and simulator.

 

bad news:

   when I attach the NDK to the PB app - and app hangs until I kill the debugger session...

 

warning: .dynamic section for "C:/bbndk-10.0.4-beta/target/qnx6/armle-v7/lib/libpps.so.1" is not at the expected address (wrong library or version mismatch?)
warning: Could not load shared library symbols for 2 libraries, e.g. libCore.so.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"? 
Developer
Developer
mdd
Posts: 225
Registered: ‎01-17-2012
My Device: PB

Re: Debug ANE?

one more useful bit:

 

when you launch your app, check that the console shows the size of the ANE's swf... and the ID is correct.

 

Regards,

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

Re: Debug ANE?

The action XML tag seem to do the trick for the createExtnsionContact exception. Thanks. Now it is throwing when I try to call into the ANE. Will need to do a little more work to trace and try out the ANE debug.

With that, are you suppose to start the debug before launching the app to the device or after? Does not seem to do anything once I start the debug with the required target.
Developer
Developer
mdd
Posts: 225
Registered: ‎01-17-2012
My Device: PB

Re: Debug ANE?

you can start it before, but there will be no task to attach to.  When the app starts, hit refresh, then select the task.

Developer
Developer
mdd
Posts: 225
Registered: ‎01-17-2012
My Device: PB

Re: Debug ANE?

oh yes, I had the same issue: turned out that the ctx was null... possibly, means that the ane id is different.

 

trace( this._ctx )

 

Regards,