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
ondrejandrej
Posts: 81
Registered: ‎03-17-2013
My Device: Dev Alpha + Z10
Accepted Solution

Qt application fails to start in Release mode

[ Edited ]

Hi,

 

I have a Qt Quick-based app, which I'd like to publish in Blackberry world. It works perfectly when it's launched from Qt Creator by clicking the green arrow button. When I follow the packaging and signing guide, all commands are executed without error (except blackberry-debugtokenrequest, which claims PBDT is already registered). However, when I try to start the application on my Dev Alpha, it just asks for permission to write to shared folders (access_shared) and then immediately terminates. Next time it is started, it just terminates immediately.

What can be wrong?
Here is my bar-descriptor.xml:

<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
    <id>com.example.QMLBB</id>
    <name>QMLBB</name>
    <versionNumber>0.1.0</versionNumber>
    <description>DESCRIPTION</description>
    <initialWindow>
        <autoOrients>true</autoOrients>
        <systemChrome>none</systemChrome>
        <transparent>false</transparent>
    </initialWindow>
    <author>none</author>
    <copyright>COPYRIGHT</copyright>
    <env value="app/native/imports:/usr/lib/qt4/imports" var="QML_IMPORT_PATH"/>
    <env value="app/native/plugins:/usr/lib/qt4/plugins" var="QT_PLUGIN_PATH"/>
    <env value="app/native/lib:/usr/lib/qt4/lib/" var="LD_LIBRARY_PATH"/>
    <arg>-style</arg>
    <arg>qnxlight</arg>  
<permission>access_shared</permission> <action system="true">run_native</action> <!-- QMLBB should point to the project binary, path can be relative --> <asset path="QMLBB" type="Qnx/Elf" entry="true">PROJECTNAME</asset> <asset path="./qml">qml</asset> <authorId>gYAAgEl1FC6kSYWgAVnyIqH7hC4</authorId> </qnx>

 My Dev Alpha OS version is 10.0.10.263. My BB 10 Native SDK version is 10.0.9.1673. I'm running Ubuntu 12.04, 64-bit.

 

 


SQL Terminal – command-line interface to local SQLite database
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Qt application fails to start in Release mode

The usual reason for something like this is that your app is trying to modify files in the app/ folder, which works (as a convenience for deploying) only in debug mode (i.e. unsigned apps).

Do you try writing to app/assets or any other folder under apps/?

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!
Developer
ondrejandrej
Posts: 81
Registered: ‎03-17-2013
My Device: Dev Alpha + Z10

Re: Qt application fails to start in Release mode

 

I use only QSettings in my app, have no idea where QSettings creates its file. But it shouldn't be apps.

 

I also write data to shared folders, but I have the corresponding entry in bar-descriptor for it (I updated the first post).


SQL Terminal – command-line interface to local SQLite database
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Qt application fails to start in Release mode

Another item that's got to be wrong, unless you deliberately obscured it for your post, is the <author>none</author>. I'm pretty sure your vendor name is not "none". I have no idea if that could prevent if from launching properly though.

Another step I recommend to those troubleshooting such issues is to modify your app so the *very first* lines of code that execute do something like writing to shared/misc/mybadapp.log. If you run it (after having tested to make sure those lines work in dev mode) in signed mode and do not see that file created/modified, then you can at least eliminate all your own code as being involved.

Also, did you verify that the signing is actually correct and complete?

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!
Developer
ondrejandrej
Posts: 81
Registered: ‎03-17-2013
My Device: Dev Alpha + Z10

Re: Qt application fails to start in Release mode

 

Vendor name is really "none". When I was filling the request form for the signing key, I entered "none" as the name of my company, since I'm an individual.

 

I'll try that with the log file and get back (I'm on a different computer now).

 


SQL Terminal – command-line interface to local SQLite database
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Qt application fails to start in Release mode

If you haven't released any apps before now, you should probably re-request signing keys and use your own name instead of "none". I strongly suspect having "none" will prevent you from releasing your apps in BB World, when it comes to that. Or cause some other problem... In case they're not making the instructions clear yet, I believe you're supposed to just use your own name if you do not have a registered company.

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!
BlackBerry Development Advisor
elena_laskavaia
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: Qt application fails to start in Release mode

Does qt creator modify this some-how on the fly?

 

  <asset path="QMLBB" type="Qnx/Elf" entry="true">PROJECTNAME</asset>

Because it does not make much sense - it should be binary name/path there

Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: Qt application fails to start in Release mode

Try adding 

<arg>-platform</arg>
<arg> blackberry</arg>  

 

Developer
ondrejandrej
Posts: 81
Registered: ‎03-17-2013
My Device: Dev Alpha + Z10

Re: Qt application fails to start in Release mode

elena_laskavaia:
I thought binary executable name is the same as project name. This way it is entered on the second picture in Porting Qt app guide. How do you think it should look like?


SQL Terminal – command-line interface to local SQLite database
Developer
ondrejandrej
Posts: 81
Registered: ‎03-17-2013
My Device: Dev Alpha + Z10

Re: Qt application fails to start in Release mode

 

I finally realized that the path in this xml tag:

<asset path="QMLBB" type="Qnx/Elf" entry="true">PROJECTNAME</asset>

 is not a path to application executable on the target filesystem, but on my PC. So far I must have been running blackberry-nativepackager in the source code directory, so I have packaged some rubbish file instead of the executable. Qt Creator's working directory is the one with the binaries. I now run native packager in the directory, where Qt Creator built the Release binaries and everything is working fine. Application starts fine.


SQL Terminal – command-line interface to local SQLite database