Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Build Qt from source for Android on Ubuntu
Qt 6.12 LTS is out! See what's new in the release blog

Build Qt from source for Android on Ubuntu

Scheduled Pinned Locked Moved Unsolved Qt 6
1 Posts 1 Posters 588 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    range36rus
    wrote on last edited by
    #1

    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

    -qt-host-path
    

    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.
    

    photo_2021-03-19_19-55-34.jpg

    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
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt
    • Unsolved