[Development] androiddeployqt - how it works or should work?

Eskil Abrahamsen Blomfeldt eskil.abrahamsen-blomfeldt at digia.com
Mon Nov 4 10:35:41 CET 2013

On 11/01/2013 07:01 PM, Felipe Crochik wrote:
> I understand androiddeployqt is supposed to separate the "deployment" 
>  from qt but to be honest so far it seems to be harder than before - 
> probably because I just don't know how is supposed to work.
> Before you would have all the "android files" added to your project 
> and could control them with the *.pro file and macros.
> If I am guessing right, now anything that is specific to android is 
> "auto generated" and if the developer wants to customize  he has to 
> add to the project and add something like "ANDROID_PACKAGE_SOURCE_DIR 
> = $$PWD/android"  to the tell the tool to copy these files over the 
> auto generated ones.
> Is there any documentation for how to control androiddeployqt? A few 
> things that I couldn't figure out:

The documentation is here:


> 1. how to get rid of all the "--Added-by-androiddeployqt--" items that 
> get "bundled_in_assets" ? I assume I can edit the "libs.xml" but not 
> sure this is the recommended way.

You can override the autodetected dependencies by setting the


variable in your .pro file. If you do this, then you will not benefit 
from the auto-detection and will need to list all the dependencies 

Note that right now, androiddeployqt will bundle all the QML imports 
which are supported by your application's module dependencies. In the 
future, only the imports which are actually used by your QML files will 
be included.

> 2. creating a "custom" AndroidManifest.xml file is something that I 
> imagine will happen quite often but it seems that the file includes 
> things that are auto generated. Is there any mechanism in place to 
> merge "my version" with the changes from the tool?

Take the AndroidManifest.xml template from Qt 
($QT/src/android/java/AndroidManifest.xml), put it in a folder in your 
project and set this folder as the ANDROID_PACKAGE_SOURCE_DIR in your 
.pro file. Alternatively, you can click on the "Create 
AndroidManifest.xml" button in Qt Creator.

> 3. With the first qt5.2 beta all the plugins were included 
> automatically. With the one today it seems that this has changed. For 
> instance the qmllocalstorageplugin is not included automatically 
> anymore. Is this a bug or is it something that I have to manually 
> specify (if so, how?)

The plugins are included automatically, but you have to list the module 
dependencies of the plugin as dependencies of your app. For instance, 
since the local storage plugin depends on QtNetwork and QtSql, you have 
to add "QT += sql network" in your .pro file. This was also required in 
Qt 5.1. The reason for this is to avoid depending on all Qt libraries 
for all apps.

When we implement scanning the actual imports used by your app, we can 
improve this for QML, and automatically include all imports that are 
used as well as their dependencies automatically. The logic will still 
be needed for regular plugins though, as there's no way to statically 
detect which plugins will be required at run-time.

-- Eskil

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

More information about the Development mailing list