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
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Execution failure of ported Qt app

I'm trying to port an existing Qt app to RIM's Qt on GitHub. I keep running across the following dreaded error in the app's logs directory:

 

Failed to load platform plugin "blackberry". Available platforms are:

 


I have the following in my main() function:

 

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

 

From my bar-descriptor.xml, the following lines are relevant:

 

<asset path="icon.png">icon.png</asset>
<asset path="MyApp" type="Qnx/Elf" entry="true">MyApp</asset>
<asset path="LICENSE">LICENSE</asset>
<asset path='/path/to/Qt/stage/nto/armle-v7/usr/lib/qt4/lib/libbbsupport.so.4' type='Qnx/Elf'>lib/libbbsupport.so.4</asset>
<asset path='/path/to/Qt/stage/nto/armle-v7/usr/lib/qt4/lib/libQtCore.so.4' type='Qnx/Elf'>lib/libQtCore.so.4</asset>
<asset path='/path/to/Qt/stage/nto/armle-v7/usr/lib/qt4/lib/libQtGui.so.4' type='Qnx/Elf'>lib/libQtGui.so.4</asset>
<asset path='/path/to/Qt/stage/nto/armle-v7/usr/lib/qt4/lib/libQtXml.so.4' type='Qnx/Elf'>lib/libQtXml.so.4</asset>
<asset path='/path/to/Qt/stage/nto/armle-v7/usr/lib/qt4/plugins/platforms/libblackberry.so' type='Qnx/Elf'>lib/platforms/libblackberry.so</asset>

<action system="true">run_native</action>
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>

 

It is being packaged with the following command in my qmake .pro:

 

package.commands += blackberry-nativepackager \
-devMode -debugToken $${DEBUG_TOKEN} \
-buildId $${SRC_VERSION} \
-package $${TARGET}-$${VERSION}.bar \
-arg -platform -arg blackberry \
$${PACKAGING_OPTIONS} \
bar-descriptor.xml

 

(DEBUG_TOKEN points to a valid debug token, SRC_VERSION and VERSION are programatically dealt with earlier in the file, and for this case PACKAGING_OPTIONS is empty.)

 

I also have the following line which appears to be correctly parsed, looking at the build output:

 

LIBS += -lbbsupport -lsocket

 

Looking inside my packaged bar, it looks to have the proper libs in the correct places:

 

Archive: MyApp-0.0.1.330.bar
testing: META-INF/MANIFEST.MF OK
testing: native/bar-descriptor.xml OK
testing: native/lib/libbbsupport.so.4 OK
testing: native/LICENSE OK
testing: native/icon.png OK
testing: native/MyApp OK
testing: native/lib/platforms/libblackberry.so OK
testing: native/lib/libQtGui.so.4 OK
testing: native/lib/libQtXml.so.4 OK
testing: native/lib/libQtCore.so.4 OK
No errors detected in compressed data of MyApp-0.0.1.330.bar.

 

Does anyone have any clues and/or suggestions as to what may be wrong and what I should be looking at next? As far as anything says, this configuration should be correct (libblackberry.so is in the proper place, as is libbbsupport.so.4 and LD_LIBRARY_PATH and addLibraryPath() are correct).

 

And, yes, minimal Qt apps are working fine and have almost identical bars. This is probably a pretty dumb oversight somewhere, but I'm not finding it. It doesn't help that it appears RIM hasn't ported any Qt apps on GitHub so we can see what's been done for them.

 

And, finally, this is all from the CLI as there is not documentation on properly importing an existing Qt app into qde and I gave up trying to make qmake happy in qde. (And there's even less documentation for using the same Qt project from both CLI and qde builds.)



Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Like this post too! Smiley Very Happy
Retired
Posts: 172
Registered: ‎06-07-2010
My Device: BlackBerry 8520
My Carrier: Rogers

Re: Execution failure of ported Qt app

Hello lewellyn,

 

How are you doing? I hope all is well.

 

I’ve had a look at some of the code, and notice that the environment variable QT_QPA_PLATFORM_PLUGIN_PATH should be set. Another way to inform the system of the path is via the command line argument “–platformpluginpath  <path>”. In this case the path is probably “app/native/lib”.

 

You mentioned minimal Qt apps are working fine.

Perhaps you are using QT_QPA_PLATFORM_PLUGIN_PATH or –platformpluginpath. Can you confirm and let me know? 

Raihan Masroor
BlackBerry Development Advisor
Developer
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Re: Execution failure of ported Qt app

I had thought that as well, at first, but no luck. :/

From the top of my source tree:


$ egrep -r '(PLUGIN_PATH|pluginpath)' . | wc -l
0


Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Like this post too! Smiley Very Happy
Highlighted
Retired
Posts: 172
Registered: ‎06-07-2010
My Device: BlackBerry 8520
My Carrier: Rogers

Re: Execution failure of ported Qt app

Hello lewellyn,

 

Sorry for the late reply. Can you give me the source tree for one of the working minimal qt apps?

 

Looking forward to your reply.

Raihan Masroor
BlackBerry Development Advisor