Important: Please read the Qt Code of Conduct -

Build Qt from source for Android on Ubuntu

  • Hello. I want build Qt 6.0.2 for Android. My config:

    • Ubuntu 20.04 x64
    • cmake version 3.16.3
    • ninja 1.10.0
    • openjdk version "1.8.0_282"
    • perl 5, version 30, subversion 0 (v5.30.0)
    • gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
    • Qt Creator 4.11.1 Based on Qt 5.14.1 (GCC 5.3.1 20160406 (Red Hat 5.3.1-6), 64 bit)

    ThenI wrote script for building:

    cd /home/range/Downloads/qt-everywhere-src-6.0.2/qtbase/
    sed -i 's/\r//' configure
    ./configure -prefix /home/range/apps/Qt5.14.2/6.0.2/static_desktop/ -opensource -confirm-license -nomake examples -nomake tests -qt-zlib -qt-libpng -skip qttranslations -skip qtserialport -no-warnings-are-errors -opengl desktop -static
    cmake --build . --parallel
    cmake --install .
    ./configure -xplatform android-clang -prefix /home/range/apps/Qt5.14.2/6.0.2/static_android/ -disable-rpath -nomake tests -nomake examples -android-ndk /home/range/Android/Sdk/ndk/20.0.5594570 -android-sdk /home/range/Android/Sdk -opensource -confirm-license -no-warnings-are-errors -make libs -qt-zlib -qt-libpng -skip qttranslations -skip qtserialport -qt-host-path /home/range/apps/Qt5.14.2/6.0.2/static_desktop/ -static -android-abis armeabi-v7a
    cmake --build . --parallel
    cmake --install .

    Firstly I build static Qt for desktop, so that using his for


    for building for Android.
    Secondly I build static Qt for Android.
    When I add Qt profile in Qt Creator, so I get error:

    Failed to detect the ABIs used by the Qt version. Check the settings in Devices -> Android for errors.


    How this fix it?
    Also, I tried build simple Qt Quick application using Qt 6.0.2 for desktop, which I build earlier and get error:

    Project ERROR: Unknown module(s) in QT: quick

Log in to reply