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

Native Development

Reply
Developer
rmisk
Posts: 64
Registered: ‎02-21-2012
My Device: Blackberry Playbook
Accepted Solution

A Hello World using the NDK CLI tools Crashes After Splash Screen

I have been trying the tutorial for NDK CLI that downloads:

#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton button("Hello Playbook World!");
QObject::connect(&button, SIGNAL(clicked()), &app, SLOT(quit()));
button.show();
return app.exec();
}

 

Using qmake, blackberry-nativepackager,  and blackberry-deploy to deploy to a tablet.  It downloads and executes but right after the splash screen appears the app crashes.

 

I have double checked everything and downloaded numerous times with no success.  Would anyone have some ideas on how I might troubleshoot this?

 

Roger

 

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: A Hello World using the NDK CLI tools Crashes After Splash Screen

If you're using command line tools, you need to learn either how to use SSH to get into the device, or how to use blackberry-deploy with the -getFile option to retrieve the file "log" in the logs/ folder under your app's current directory after it runs.

The full path would be like /accounts/1000/appdata/yourappfolderhere/logs/log. The name of the app's folder is a combination of the app package name (e.g. ca.engenuity.PowerMon for one of my apps, as an example) with the package id appended with a dot separating them. There's probably a bit clearer description around if you search for "getFile log" or something. I use SSH which I find easier and more powerful...

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
rmisk
Posts: 64
Registered: ‎02-21-2012
My Device: Blackberry Playbook

Re: A Hello World using the NDK CLI tools Crashes After Splash Screen

Thanks Peter, I can and have used SSH so I will check out the log file, I expect the log file info you provided is what I need.

Please use plain text.
Developer
rmisk
Posts: 64
Registered: ‎02-21-2012
My Device: Blackberry Playbook

Re: A Hello World using the NDK CLI tools Crashes After Splash Screen

Peter,

 

That worked it allowed me to find, from another post, that I needed to add:

 

<env var="QT_QPA_FONTDIR" value="/usr/fonts/font_repository/liberation"/>

 

to bar-descriptor.xml file.

 

Now the example works.

 

Thanks,

  Roger

Please use plain text.
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: A Hello World using the NDK CLI tools Crashes After Splash Screen

you'll need at least

QCoreApplication::addLibraryPath("app/native/lib");

and probably

qputenv("QT_QPA_FONTDIR", "/usr/fonts/font_repository/monotype");

 before you create QApplication object;

Please use plain text.
Developer
rmisk
Posts: 64
Registered: ‎02-21-2012
My Device: Blackberry Playbook

Re: A Hello World using the NDK CLI tools Crashes After Splash Screen

[ Edited ]

Thanks BGmot for that and the original clue that got the example application running, i.e.

<env var="QT_QPA_FONTDIR" value="/usr/fonts/font_repository/liberation"/>

 

 

I have these now:

 

<env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
<env var="QT_QPA_FONTDIR" value="/usr/fonts/font_repository/liberation"/>

 

I guess I will need to specifically add other such as monotype and adobe depending on the fonts I use?

 

Roger

Please use plain text.
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: A Hello World using the NDK CLI tools Crashes After Splash Screen

I have not figured out what fonts Qt is using as trying to set up different ones did not lead to any change in appearance.

Please use plain text.
Developer
bskania
Posts: 105
Registered: ‎04-24-2012
My Device: blackberry developer

Re: A Hello World using the NDK CLI tools Crashes After Splash Screen

[ Edited ]

Hello

 

I am using latest 2.1.0 blackberry native SDK.

 

I am trying to make QThelloworld application on mac 10.7

I had followed the step given here

http://qt-project.org/wiki/QNX

 

Now I am trying to deploy the app on the playbook simulator.

So that I had run all the ccommand of the x86 folder.

 

But after deploying the app on the playbook it crashes and gives error of the Font.

So I added the enviornment variable that is suggested.

But still error remain as it is.

Please help me in that.

Thanks in advance.

bskania.

Please use plain text.
Developer
bskania
Posts: 105
Registered: ‎04-24-2012
My Device: blackberry developer

Re: A Hello World using the NDK CLI tools Crashes After Splash Screen

I am getting error whilw building the project from QT creator for simulator,

 

17:24:47: Running steps for project QTGod...

17:24:47: Configuration unchanged, skipping qmake step.

17:24:47: Starting: "/usr/bin/make" clean -w

make: Entering directory `/Users/css/ndk-2.1.0-workspace/QTGod'

rm -f main.o

rm -f *~ core *.core

make: Leaving directory `/Users/css/ndk-2.1.0-workspace/QTGod'

17:24:47: The process "/usr/bin/make" exited normally.

17:24:55: Could not find packager command '%s' in the build environment

Error while building/deploying project QTGod (target: QNX x86)

When executing step 'Create Bar package'

 

Please help me.

I had tried both the way NDK CLI and also QTcreator with qt 4.8.0 form git hub.

 

Thanks in advance

bskania

Please use plain text.
BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: developer

Re: A Hello World using the NDK CLI tools Crashes After Splash Screen

Please don't post new questions to threads that have an accepted solution.

You'll have more success if you post to a new thread, and perhaps give a link to the other thread.

Please use plain text.