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
nunocastro
Posts: 15
Registered: ‎11-17-2011
My Carrier: Vodafone

Re: Failed to load platform plugin "". Qt in Momentics IDE.

Everyting apears to be ok.

I haven't yet tryed building with NDK 2, all my developments have been with NDK 1.
Maybe there are still some incompatibilities between QT and the NDK 2

Concerning the build of QT, from what I can understand the only platform where it build without issues is Linux.
In windows it needs some tweaks to build, and on OSX I've only been able to build for the device.

Let me know how it went with the build with NDK 1.

Regards.

Nuno Castro
Please use plain text.
Developer
BGmot
Posts: 1,061
Registered: ‎11-24-2011
My Carrier: x

Re: Failed to load platform plugin "". Qt in Momentics IDE.

According to QT source code (I went that far) you can specify path to platforms in two ways:

1) set up env variable QT_QPA_PLATFORM_PLUGIN_PATH accordingly ( to app/native/lib/platforms)

2) pass an argument -platformpluginpath app/native/lib/platforms (in addition to --platform blackberry)

Nevertheless neither method works for me on simulator

I always get the message "Failed to load platform plugin "blackberry". Available platforms are: "

And clicking on Debug does copy libblackberry.so to Simulator:

$ ls -l /apps/com.BGmot.QTHelloWorld.testDev_THelloWorldb7010191/native/lib/platforms/ 
total 430
-rwxr-x---   1 apps      dev4         219972 Dec 15 16:57 libblackberry.so

I am lost at this point -( 

 

PS: my development platform is Mac.

 

Please use plain text.
Developer
BGmot
Posts: 1,061
Registered: ‎11-24-2011
My Carrier: x

Re: Failed to load platform plugin "". Qt in Momentics IDE.

Further investigation showed that plugins by default are loaded from $LD_LIBRARY_PATH/platforms. $LD_LIBRARY_PATH=app/native/lib - it is set up in Environment section of debug session in NDK so you do not need to specify either QT_QPA_PLATFORM_PLUGIN_PATH or -platformpluginpath.

My problem with loading libblackberry.so was that it requires at least these libraries to be deployed to Simulator:

libQtGui.so.4

libQtCore.so.4

libQtOpenGL.so.4

Trying to minimize number of libraries I was not deploying OpenGL as soon as I added it the problem got resolved. -)

 

PS: when you troubleshooting platform plugins loading issues you can set QT_DEBUG_PLUGINS variable to 1 which will bring lots of useful debug info to your console ;-)

Please use plain text.
New Contributor
haqman
Posts: 2
Registered: ‎02-05-2012
My Carrier: Vodafone

Re: Failed to load platform plugin "". Qt in Momentics IDE.

Hi All,

 

With reference to: http://hecgeek.blogspot.com/2011/10/qt-for-blackberry-playbook.html

 

Here is what I've done to make it work:

 

First of all:

You no longer need libbbsupport.so, so remove the line LIBS += -lbbsupport from the .pro file.

Finally:

Add the following to the .xml file:

< env var="QT_DEBUG_PLUGINS" value="1" / >
< env var="LD_LIBRARY_PATH" value="app/native/lib" / >
< env var="QT_QPA_FONTDIR" value="/usr/fonts/font_repository/liberation" / >
< env var="QT_QPA_PLATFORM_PLUGIN_PATH" value="app/lib/platforms" / >

 

That is it folks!

Tested with lates Git snapshot from Blackberry's Qt repo, as of this date (5/Feb/2012).

Please use plain text.
Developer
BGmot
Posts: 1,061
Registered: ‎11-24-2011
My Carrier: x

Re: Failed to load platform plugin "". Qt in Momentics IDE.

< env var="QT_DEBUG_PLUGINS" value="1" / > is useful only for debugging, if you app starts ok then remove it, it dumps debug information to console that you do not generally need.

Please use plain text.
Developer
jheron
Posts: 188
Registered: ‎01-27-2012
My Carrier: ...

Re: Failed to load platform plugin "". Qt in Momentics IDE.

If your app utilizes gif or jpg images you will also need to add the image format plugins as follows:

Package the plugins via the pro file:

-e $$[QT_INSTALL_PLUGINS]/imageformats/libqgif.so lib/plugins/imageformats/libqgif.so

and then add a variable to the descriptor xml like this:

<env var="QT_PLUGIN_PATH" value="app/native/lib/plugins"/>

If you need jpg support add the libqjpg.so the way to the imageformats folder.

Cheers,

Jon

Please use plain text.
Developer
yalnte
Posts: 44
Registered: ‎06-16-2012

Re: Failed to load platform plugin "". Qt in Momentics IDE.

Hi,

 

Thanks for your help. Just a minor comment, I tried using:

 

<env var="QT_QPA_PLATFORM_PLUGIN_PATH" value="app/lib/platforms" />

 

but it didn't work for me. Instead I used:

 

<env var="QT_QPA_PLATFORM_PLUGIN_PATH" value="app/native/lib/platforms" />

 Regards,

Tom

----------------------------------------------------------------------------------
Blog: http://partialpivot.blogspot.co.uk/
Please use plain text.