[Android-development] QML Images in Necessitas

Eskil Abrahamsen Blomfeldt eskil.abrahamsen-blomfeldt at digia.com
Mon Mar 24 14:05:24 CET 2014


On 03/24/2014 12:44 PM, Atul Dubey wrote:
> Hie,
>
> I've been trying to deploy a QML file with some images to Android. But 
> I always get the error that "could not load asset"... The images are 
> never rendered in the Android version whereas they work well with the 
> desktop version...
>
> Please suggest a remedy for this...

Hi,

This list is mainly to discuss the development of Qt for Android. 
Necessitas is a project which is maintained by KDE, and not by the Qt 
Project, so please refer to their mailing list there:

     necessitas-devel at kde.org

My hunch, though, is that you are deploying the QML inside your APK's 
assets, referring to the image using a relative path, but not deploying 
the images in the assets folder. Try using qrc for both the QML and 
images (and any other resources). This is a cross-platform way of 
deploying resources with Qt:

     http://qt-project.org/doc/qt-5/resources.html

Note that there is also support for creating and maintaining the qrc 
files in Qt Creator.

-- Eskil

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/android-development/attachments/20140324/abf0da21/attachment.html>


More information about the Android-development mailing list