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
dbigham
Posts: 521
Registered: ‎04-01-2009
My Device: Z10, PlayBook
Accepted Solution

Can't get "Hello World" AIR app to work in BB10 SDK 3

I've followed the instructions here:

 

https://developer.blackberry.com/air/documentation/bb10/create_your_first_application_cmd_ms_2010847...

... and here:

https://developer.blackberry.com/air/documentation/bb10/testing_your_application_cmd_ms_2010851_11.h...

 

When I compile and run the app using:

 

amxmlc Example.as

blackberry-airpackager -package Example.bar -installApp -launchApp Example-app.xml Example.swf bar-descriptor.xml QNXSkins.ane QNXDevice.ane QNXNetwork.ane QNXSensors.ane blackberry-tablet-icon.png -device 192.168.64.131 -password playbook

 

... I get a white screen with no text on it.

 

If I follow the "Debug your application using the command line" instructions on the later page, then I get:

 

E:\Users\Daniel\Dropbox\Apps\BB10Example2>fdb
Adobe fdb (Flash Player Debugger) [build 23201]
Copyright (c) 2004-2007 Adobe, Inc. All rights reserved.
(fdb) run
Waiting for Player to connect
Player connected; session starting.
Set breakpoints and then type 'continue' to resume the session.
[SWF] qnx.fuse.ui.skins.QNXSkins - 603,349 bytes after decompression
[SWF] Example.swf - 458,642 bytes after decompression
(fdb) c
[Fault] exception, information=TypeError: Error #1007: Instantiation attempted on a non-constructor.
Fault, createCSS() at ThemeWhite.as:25
25 // code goes here
(fdb)

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

Re: Can't get "Hello World" AIR app to work in BB10 SDK 3

Are your paths set correctly to go against the 3.0 libraries?
Please use plain text.
Developer
dbigham
Posts: 521
Registered: ‎04-01-2009
My Device: Z10, PlayBook

Re: Can't get "Hello World" AIR app to work in BB10 SDK 3

Yes:

 

set JAVA_HOME=E:\Program Files (x86)\Java\jre6
set PATH=%PATH%;E:\Program Files\Research In Motion\blackberry-tablet-sdk-3.0.0\bin

Please use plain text.
Developer
UberschallSamsara
Posts: 1,026
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: Can't get "Hello World" AIR app to work in BB10 SDK 3

[ Edited ]

dbigham wrote:

Yes:

 

set JAVA_HOME=E:\Program Files (x86)\Java\jre6
set PATH=%PATH%;E:\Program Files\Research In Motion\blackberry-tablet-sdk-3.0.0\bin


Your set PATH line *appends* to whatever is in your %PATH% - and if you have a path to a different SDK earlier in your %PATH%, then when you type amxmlc you'll get the version of amxmlc that's found earliest in your PATH variable as it exists in the shell you execute the command in.  I prefer never to depend on the contents of my PATH variable.  Instead, my build scripts set an SDK path environment variable explicitly and all amxmlc calls are prepended with that SDK path environment variable.  You might want to echo your $PATH in the shell you're executing amxmlc in and confirm that it does not contain any other SDK paths before the 3.0 path....

 

Edit:  Of course, if you have some path setup script that you trust yourself to always run in the shell where you are building your project, and that path setup script reliably places the correct SDK path at the highest priority in your PATH variable, then that build flow variation could work too.

Please use plain text.
Developer
dbigham
Posts: 521
Registered: ‎04-01-2009
My Device: Z10, PlayBook

Re: Can't get "Hello World" AIR app to work in BB10 SDK 3

Please use plain text.
Developer
UberschallSamsara
Posts: 1,026
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: Can't get "Hello World" AIR app to work in BB10 SDK 3

When I went through the Hello World example, I seem to remember "needing" to copy the .ane file to my project directory instead of giving the SDK path to it on my blackberry-airpackager commandline ... but I don't recall now

whether failing to do so resulted in the .bar not getting built, or if I had a runtime error.  The Hello World example did work for me (i.e. displayed the Hello World text) on the dev alpha using the commandline based tutorial that you linked to.  There was another recent thread where someone got the same error message you did about a non-constructor, which was (apparently) due to an incorrect SDK path.

Please use plain text.
Developer
dbigham
Posts: 521
Registered: ‎04-01-2009
My Device: Z10, PlayBook

Re: Can't get "Hello World" AIR app to work in BB10 SDK 3

Finally figured out the problem. You were very much on the right track:

 

I must have installed the SDK previously, because there was a "blackberry-tablet-sdk-3.0.0" directory here:

 

E:\Program Files\Research In Motion\blackberry-tablet-sdk-3.0.0

 

When I installed the most recent SDK a few nights ago, I noticed that the directory name was still "blackberry-tablet-sdk-3.0.0", so great.

 

Then bam, these problems.

 

What I finally discovered is that the more recent installer defaults to:

 

E:\Program Files\Research In Motion (x86)\blackberry-tablet-sdk-3.0.0

 

Notice anything?  Neither did I, but:

 

E:\Program Files\Research In Motion\blackberry-tablet-sdk-3.0.0

=!=

E:\Program Files\Research In Motion (x86)\blackberry-tablet-sdk-3.0.0

 

 

Why on earth would they have changed the default installation directory?  What this meant was that my build scripts were still referencing the old E:\Program Files\Research In Motion\blackberry-tablet-sdk-3.0.0 directory.

Please use plain text.
Developer
UberschallSamsara
Posts: 1,026
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: Can't get "Hello World" AIR app to work in BB10 SDK 3

One other thing you might consider for future SDK installs:  Override the default install path and name the path yourself to not use any directory names with spaces in them.  For example, my SDK's live in a "C:\Dev\SDKs\RIM\" directory.  Way back when, during the pre launch for PlayBook, there was a comment in one of the webinars about how the command line tools could potentially get confused by pathnames that had spaces in them.  Ever since then I have avoided using any such pathnames, since I expect to be using a commandline flow for the foreseeable future.

Please use plain text.