Android deployment: QtCreator does not call androiddeployqt



  • With QtCreator 3.01 from the Qt 5.2.1 build (Windows 7, 32 bit) I am having various issues to deploy the Qt app to Android.
    Whatever I do there is no way that QtCreator does the necessary deployment steps. It always stops right after building the armv7 files stating that he finished all tasks. The .pro file contains:

    @TARGET = SID_Tablet
    TEMPLATE = app
    CONFIG += mobility
    MOBILITY =
    ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
    ...
    OTHER_FILES +=
    android/AndroidManifest.xml@

    but there is no indication that qmake does something related to Android deployment to the generated files (which, again to my understanding, it should do based on the given ANDROID_PACKAGE_SOURCE_DIR). The project setup includes the correct settings for NDK (8) and SDK (22.6.2). However I do not see any steps to call androiddeployqt or anything related to deploy (as I would expect according to the docs) in the Kit setup.

    I have been succesfully deploying to Android with the Necessitas SDK some time ago - however the changes with Qt 5.2.1 do seem indicate a change of paradigm which simply does not work here.

    So my confusion is: Is QtCreator and qmake in Qt 5.2.1 supposed to do something which aids in creating and deploying apk file? Because I can not observe anything in this direction besides building the binary and json file.

    Thanks in advance for any answer.

    Regards,

    Oliver


  • Moderators

    [quote author="Groucho" date="1396452276"]So my confusion is: Is QtCreator and qmake in Qt 5.2.1 supposed to do something which aids in creating and deploying apk file? Because I can not observe anything in this direction besides building the binary and json file.[/quote]

    Hi and welcome to the forum.

    Yes, Qt Creator should automatically do everything you need to run Android apps. You need the dependencies (Android NKD, SDK), and a build of Qt for Android (it is a separate package on the downloads page; or you can compile it yourself).

    One you have a Kit set up, Qt Creator will automatically create the APK and run it on your device or the simulator (depending on your choice). I suspect your Kit setup might be wrong. Can you post a screenshot of Qt Creator's settings opened on your android Kit?



  • Thanks for the answer. In general the Android setup is complete. I can indeed create apks by manually applying androiddeployqt which will in the end create an apk. This also has some flaws as files are not copied correctly in the final destination folders and I have to manually intervene but at least it works.

    Here are the screenshots of the preferences (sorry, German only but I believe you get the point):

    !https://lh6.googleusercontent.com/-bUbLSDE37AU/Uzw5wbT8NCI/AAAAAAAAAks/pi6m8iTkRUw/w900-h633-no/qtandroid2.png!

    !https://lh3.googleusercontent.com/-PqO1P0A2_KU/Uzw5wa5EPoI/AAAAAAAAAko/k2-aeKL-FI8/w899-h691-no/qtandroid1.png!

    !https://lh5.googleusercontent.com/-tLIem-RufuM/Uzw5zIUaqQI/AAAAAAAAAk4/GbKksBBiL_c/w794-h654-no/qtandroid4.png!

    !https://lh6.googleusercontent.com/-KJ6sNUY7sY4/Uzw5zEYvURI/AAAAAAAAAlA/HnGDH7-Q418/w787-h603-no/qtandroid5.png!

    !https://lh5.googleusercontent.com/-wbFfC_nv4Gw/Uzw50EZy1qI/AAAAAAAAAlE/0OQnjtXLEtY/w990-h663-no/qtandroid3.png!

    I am pretty sure it is ok. It only compiles and then succesfully ends without deployment.

    Thanks in advance,

    Oliver


  • Moderators

    No problem, I understand German.

    The configuration seems ok. I have one possible clue: you have a build configuration for both Desktop and Android. In both cases, qmake will generate a Makefile... it may happen that your Android build encounters the desktop Makefile and goes "hey, it's already there". Try cleaning the project (if necessary, also removing the Makefile by hand), and then building again.



  • Thanks for the feedback. In fact I now did fresh checkout of the project and removed the kits and reconfigured it. Then triggered a build into a fresh directory: No change. It stops after compiling reporting success.

    So now I did it manually from the console. Calling qmake with the same parameters (fresh build directory) produced a Makefile and the json file. So far, so good. Building it produced the same output as with QtCreator- a library in the install directory.

    Next step: Manually calling androiddeployqt. This reported missing qt sources in the deploy dir which is correct- they are not there. However my understanding for the build process is that during building these should be automatically copied from the templates- the question is: by whom? qmake? androiddeployqt? make install?

    There is a step missing in the whole process and I am wondering which.

    Regards,

    Oliver



  • Well, not really solved. I am able to deploy from the command shell with minimum additional effort.
    However I see that androiddeployqt does not consider entries from the directory from the ANDROID_SOURCE_DIR and uses the QT templates instead. I have to manually copy AndroidManifest.xml and resources if I want different files packed in it.
    Ant in turn reports that merging of AndroidManifest.xml is disabled and that it will use the project ones (but, as I said, are then the ones from the Qt templates).

    I now assume that something changed with the current NDK which the Qt tools can´t cope with .
    Basically it works but not with a single click from QtCreator.

    Oliver


  • Moderators

    Yes, some users report that newest updates to Android NDK cause Qt to misbehave. As far as I know this happens even with Qt 5.3 beta.

    Windows only, though :) I'm using Qt 5.3 since alpha and it just works.



  • I have a problem that seems to be related to this.
    Build and deploy do not create a apk file, but run and debug do and start the apk on the device/emulator. It looks like that the only way to create a apk file from Qt Creator is to run it, but sometimes I only want to create the apk without starting the emulator.



  • The evidence for my theory is in this thread: http://qt-project.org/forums/viewthread/40833/

    Oliver


  • Moderators

    Doh, silly me! Obviously, I've always been doing a Build & Run when doing Android development.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.