Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Building Qt for Android platform from sources.
Forum Updated to NodeBB v4.3 + New Features

Building Qt for Android platform from sources.

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
12 Posts 3 Posters 2.5k Views 2 Watching
  • 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.
  • H Offline
    H Offline
    Hithendra
    wrote on last edited by Hithendra
    #1

    I am trying to cross compile openAuto for android platform. This c++ application is dependent on Qt libraries (multimedia, bluetooth, connectivity).
    So, I started cross compiling Qt for android on Linux x86_64 host machine. But, I could not build the bluetooth and multimedia libraries with some features (pulse audio, gstreamer).
    I am using NDK 16b toolchain. Android API level as 18.
    I followed the below steps:

    git clone git://code.qt.io/qt/qt5.git qt5
    
    cd qt5
    
    perl init-repository --module-subset=qtbase,qtconnectivity,qtmultimedia,qtandroidextras
    

    Are these 4 modules as input to init-repository are enough to build Qt libraries (multimedia, bluetooth, connectivity). Do I need to add any other?

    ./configure -opensource -confirm-license -android-arch armeabi -android-ndk-platform android-18 -xplatform android-g++ --disable-rpath -nomake tests -nomake examples -android-ndk /home/rthoomoju/Hithendra/NDK/android-ndk-r16b -android-sdk /home/rthoomoju/Android/Sdk -android-ndk-host linux-x86_64 -android-toolchain-version 4.9 -skip qttranslations -skip qtserialport -no-warnings-are-errors -sysroot /home/rthoomoju/Hithendra/NDK/standalone_toolchain/sysroot -c++std c++14 -pulseaudio
    

    Configure output is:
    Qt Bluetooth:

    BlueZ .................................. no
    BlueZ Low Energy ....................... no
    Linux Crypto API ....................... no
    WinRT Bluetooth API (desktop & UWP) .... no
    

    Qt Multimedia:

    ALSA ................................... no
    GStreamer 1.0 .......................... no
    GStreamer 0.10 ......................... no
    Video for Linux ........................ yes
    OpenAL ................................. no
    PulseAudio ............................. no
    Resource Policy (libresourceqt5) ....... no
    Windows Audio Services ................. no
    DirectShow ............................. no
    Windows Media Foundation ............... no
    

    Note: Also available for Linux: linux-clang linux-icc

    ERROR: Feature 'pulseaudio' was enabled, but the pre-condition 'libs.pulseaudio' failed.

    Why Qt bluetooth features are all No? Do I need to build any other dependent libraries for Android? Why enabling pulseaudio is giving the error? pulseaudio for Android need to be build separately? Please guide me ...

    1 Reply Last reply
    0
    • Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #2

      @Hithendra are you sure you need to build Qt for Android from sources yourself? I guess that installing a Qt for Linux release with Android support will provide the libraries required by the openAuto project directly. For instance, I installed Qt 5.9.0 for Linux x64 (qt-opensource-linux-x64-5.9.0.run) and checking the files installed, I can find libraries for Android already made:

      pablo@lubuntu64:/opt/Qt5.9.0/5.9/android_armv7/lib$ file libQt5Multimedia.so 
      libQt5Multimedia.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, not stripped
      

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      1
      • H Offline
        H Offline
        Hithendra
        wrote on last edited by
        #3

        @Pablo-J-Rogina Thanks for the reply.
        I thought building from the sources is the only way to get the qt libraries for android.
        I will try the installation for linux with android support.

        Thanks alot ...

        jsulmJ 1 Reply Last reply
        0
        • H Hithendra

          @Pablo-J-Rogina Thanks for the reply.
          I thought building from the sources is the only way to get the qt libraries for android.
          I will try the installation for linux with android support.

          Thanks alot ...

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Hithendra Simply use Qt online installer and select Qt for Android there...

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • H Offline
            H Offline
            Hithendra
            wrote on last edited by
            #5

            @jsulm Thanks. I am trying that. Do I need to select source components also? I need mainly bluetooth and multimedia modules?

            jsulmJ 1 Reply Last reply
            0
            • H Hithendra

              @jsulm Thanks. I am trying that. Do I need to select source components also? I need mainly bluetooth and multimedia modules?

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Hithendra If you don't need Qt sources then there is no need to select source components. Bluetooth and multimedia are already part of normal Qt installation.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • H Offline
                H Offline
                Hithendra
                wrote on last edited by
                #7

                I got the required qt libraries. @jsulm @Pablo-J-Rogina Thanks .. You saved lot of my time.

                1 Reply Last reply
                0
                • H Offline
                  H Offline
                  Hithendra
                  wrote on last edited by Hithendra
                  #8

                  @jsulm Is it possible to build Qt libraries for 64 bit arm v8?
                  I would like target for android nougat device.

                  The issue I am facing when I tried to link the Qt5 libraries generated as mentioned by you (using Qt online installer) is link error as below:

                  /home/Qt_Nougat/5.11.0/android_armv7/lib/libQt5MultimediaWidgets.so: error adding symbols: File in wrong format. 
                  

                  Please help?

                  Pablo J. RoginaP jsulmJ 2 Replies Last reply
                  0
                  • H Hithendra

                    @jsulm Is it possible to build Qt libraries for 64 bit arm v8?
                    I would like target for android nougat device.

                    The issue I am facing when I tried to link the Qt5 libraries generated as mentioned by you (using Qt online installer) is link error as below:

                    /home/Qt_Nougat/5.11.0/android_armv7/lib/libQt5MultimediaWidgets.so: error adding symbols: File in wrong format. 
                    

                    Please help?

                    Pablo J. RoginaP Offline
                    Pablo J. RoginaP Offline
                    Pablo J. Rogina
                    wrote on last edited by
                    #9

                    @Hithendra you mentioned before

                    Android API level as 18.

                    and also it looks like you installed latest Qt 5.11 with Android components

                    /home/Qt_Nougat/5.11.0/android_armv7/lib/

                    So is it working for such Android level 18?

                    Upvote the answer(s) that helped you solve the issue
                    Use "Topic Tools" button to mark your post as Solved
                    Add screenshots via postimage.org
                    Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                    1 Reply Last reply
                    0
                    • H Hithendra

                      @jsulm Is it possible to build Qt libraries for 64 bit arm v8?
                      I would like target for android nougat device.

                      The issue I am facing when I tried to link the Qt5 libraries generated as mentioned by you (using Qt online installer) is link error as below:

                      /home/Qt_Nougat/5.11.0/android_armv7/lib/libQt5MultimediaWidgets.so: error adding symbols: File in wrong format. 
                      

                      Please help?

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @Hithendra Sure, you can build Qt. But it is no an easy task.
                      See https://wiki.qt.io/Building_Qt_5_from_Git
                      http://doc.qt.io/qt-5/build-sources.html

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • H Offline
                        H Offline
                        Hithendra
                        wrote on last edited by
                        #11

                        @Pablo-J-Rogina I am able to successfully install that for API level 18.
                        Now, I am targeting API level 24 on 64 bit device. I tried to link the old libs for API level 24 onto 64 bit device. Then I got the error message while linking.

                        Pablo J. RoginaP 1 Reply Last reply
                        0
                        • H Hithendra

                          @Pablo-J-Rogina I am able to successfully install that for API level 18.
                          Now, I am targeting API level 24 on 64 bit device. I tried to link the old libs for API level 24 onto 64 bit device. Then I got the error message while linking.

                          Pablo J. RoginaP Offline
                          Pablo J. RoginaP Offline
                          Pablo J. Rogina
                          wrote on last edited by
                          #12

                          @Hithendra Ok, so for using Qt's 32 bit libraries for Android (see my first post where it shows ELF 32-bit...) without recompiling the whole Qt platform for Android 64 bit this answer may shed some light...

                          Upvote the answer(s) that helped you solve the issue
                          Use "Topic Tools" button to mark your post as Solved
                          Add screenshots via postimage.org
                          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                          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 Extensions
                          • Unsolved