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
New Developer
Posts: 129
Registered: ‎11-21-2012
My Device: Z10
My Carrier: -
Accepted Solution

Build App with qnx libraries in FlashDevelop

[ Edited ]

Hello! I have been trying to implement the payment system and to create a static cover that pauses my app when going background. I am building the app in FlashDevelop and I am encountering a tiny issue:

 

I have added the blackberry.swc and the qnx-air.swc packages to the source of my project; the code hinting works fine so I have managed to do something from the examples in the documentation.

 

Unfortunately, I missed something because when I try to build and test my app, the output throws this:

 

[Fault] exception, information=VerifyError: Error #1079: Native methods are not allowed in loaded code.

 

I googled a lot and figured that I needed to add the swc package as an external library and not include it in the app library; so, I selected that option in the "Library Asset Propierties" of the SWC File. When I build and test the app I can hear the music, but the output throws me this:

 

[Fault] exception, information=VerifyError: Error #1014: Class net.rim.blackberry.payment:: PaymentSystem could not be found.

I think I have an idea of what's going on but I cannot grasp it entirely, I am not sure how to solve it. I'm sure this is kind of a basic issue because most of the tutorials that show how to add libraries do not address this.

 

Anyone could tell me how to solve this? or help me understand what is happening and why, so I could search the correct terms, please?

 

Thank you very much! Smiley Happy

Developer
Posts: 1,269
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: Build App with qnx libraries in FlashDevelop

Are you testing your app on the desktop, on the simulator, or on a device?

New Developer
Posts: 129
Registered: ‎11-21-2012
My Device: Z10
My Carrier: -

Re: Build App with qnx libraries in FlashDevelop

[ Edited ]

On desktop and simulator.

 

Desktop gives me that error.

Simulator just sticks in the loading splash.

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

Re: Build App with qnx libraries in FlashDevelop

Try adding the following SWC and ANE files and setting the linkage to:

 

SWC Files:

 

blackberry.swc
C:\Program Files (x86)\Research In Motion\blackberry-tablet-sdk-3.X.X\frameworks\libs\blackberry
Included library

 

qnx-air.swc
C:\Program Files (x86)\Research In Motion\blackberry-tablet-sdk-3.X.X\frameworks\libs\air
External library

 

qnxmedia.swc
C:\Program Files (x86)\Research In Motion\blackberry-tablet-sdk-3.X.X\frameworks\libs\qnx
Included library

 

qnxui.swc
C:\Program Files (x86)\Research In Motion\blackberry-tablet-sdk-3.X.X\frameworks\libs\qnx
Included library

 

ANE Files:

 

QNXDevice.ane
C:\Program Files (x86)\Research In Motion\blackberry-tablet-sdk-3.X.X\frameworks\libs\qnx\ane
External library

 

QNXNetwork.ane
C:\Program Files (x86)\Research In Motion\blackberry-tablet-sdk-3.X.X\frameworks\libs\qnx\ane
External library

 

QNXSkins.ane
C:\Program Files (x86)\Research In Motion\blackberry-tablet-sdk-3.X.X\frameworks\libs\qnx\ane
External library

 

You should be able to test using the simulator. 

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
New Developer
Posts: 129
Registered: ‎11-21-2012
My Device: Z10
My Carrier: -

Re: Build App with qnx libraries in FlashDevelop

Thank you for answering Dustin!

 

I added all the files as you instructed, even tried the "include referenced classes" and "include completely", but the app keeps getting stuck at the loading splash screen.

I tried to connect the debugger in order to get any output but I couldn't; usually, when testing, I just skip that part and everything works fine, but I left the simulator for almost an hour and the app never started.

 

If it is of any use, this is what I get when I try to test via desktop:


[Fault] exception, information=VerifyError: Error #1014: Class mx.core::BitmapAsset could not be found.

 

What could I be doing wrong?

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

Re: Build App with qnx libraries in FlashDevelop

What AIR SDK version are you using? I've had no problems with AIR 3.5.

 

airversion.png

 

I copied all of the swc's and ane's to a folder in my project called lib.

 

lib.png

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
New Developer
Posts: 129
Registered: ‎11-21-2012
My Device: Z10
My Carrier: -

Re: Build App with qnx libraries in FlashDevelop

[ Edited ]

Oh... I was targeting Air 3.1 because I thought 3.5 wasn't available for BB10 yet. I changed the target to 3.5 but still have the same issue. I'm using the "BlackBerry Tablet OS SDK 3.2.1 for Adobe Air, Air 3.6" (name picked by itself when importing it to FlashDevelop) SDK if it's of any use.

 

These are my project properties:

 

ScreenCap1.jpg

 

And here is what happens (please don't mind my project loading splash screen):

 

 

ScreenCap2.jpg

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

Re: Build App with qnx libraries in FlashDevelop

Oh yes - BlackBerry 10.2 will introduce AIR 3.5 but you're correct in your assumption that up to BlackBerry 10.1 AIR 3.1 is used. 

 

Was your game/app working before you tried using the BlackBerry API's? The error message that you mention doesn't seem to me like it would be due to the BlackBerry API's.

 

I googled your error message and came across this post in stackoverflow- http://stackoverflow.com/questions/2889171/mx-corebitmapasset-could-not-be-found

 

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
New Developer
Posts: 129
Registered: ‎11-21-2012
My Device: Z10
My Carrier: -

Re: Build App with qnx libraries in FlashDevelop

[ Edited ]

Yes, everything was working. Actually, when I comment out the classes that use the BlackBerry API's and remove them from my library I can test the app in the desktop and simulator just fine.

 

The app just freezes when I include/use them.

 

I assumed that the mx.core::BitmapAsset error was caused due to the BlackBerry API's overriding somehow those classes?

Contributor
Posts: 48
Registered: ‎09-08-2013
My Device: Z10
My Carrier: None

Re: Build App with qnx libraries in FlashDevelop

interesting...can you tell me if "framework.swc", "rpc.swc" and "rpc_rb.swc" should be internally or externally linked when using the PaymentService?