Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt + Android problem

Qt + Android problem

Scheduled Pinned Locked Moved Solved General and Desktop
17 Posts 7 Posters 13.3k 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.
  • A amsantosr
    21 Sept 2018, 17:42

    @Pablo-J.-Rogina Ok,

    0_1537554714168_2018-09-21-112519_1366x768_scrot.png https://i.postimg.cc/6qhrCR3q/2018-09-21-112519_1366x768_scrot.png

    P Offline
    P Offline
    Pablo J. Rogina
    wrote on 21 Sept 2018, 19:02 last edited by
    #6

    @amsantosr your kit seems Ok, and it was auto-detected by Qt Creator.

    However, you may have been bitten by the "using latest software packages" bug. It looks like GCC was ditched from Android NDK as of revision r18 (Sep/18).

    I haven't tried it myself yet, but I suspect that it might be using some symlink so calls to gcc still works using underlying clang. But for some special conditions (the ARM options here), it may not work.

    I'd suggest to try a previous NDK release which still has GCC available...

    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

    A 1 Reply Last reply 21 Sept 2018, 20:51
    3
    • P Pablo J. Rogina
      21 Sept 2018, 19:02

      @amsantosr your kit seems Ok, and it was auto-detected by Qt Creator.

      However, you may have been bitten by the "using latest software packages" bug. It looks like GCC was ditched from Android NDK as of revision r18 (Sep/18).

      I haven't tried it myself yet, but I suspect that it might be using some symlink so calls to gcc still works using underlying clang. But for some special conditions (the ARM options here), it may not work.

      I'd suggest to try a previous NDK release which still has GCC available...

      A Offline
      A Offline
      amsantosr
      wrote on 21 Sept 2018, 20:51 last edited by amsantosr
      #7

      @Pablo-J.-Rogina Solved! I tried with android-ndk-r17c and it worked. Thank you!

      A 1 Reply Last reply 30 Sept 2018, 13:06
      2
      • C Offline
        C Offline
        cguenther 0
        wrote on 26 Sept 2018, 13:19 last edited by
        #8

        I hardly vote that this thread isn't solved. Relying on a deprecated implementation is not a solution:
        Even with Android NDK r17 the gcc part was depricated:
        https://github.com/android-ndk/ndk/wiki/Changelog-r17

        The current release removed the deprecated gcc:
        https://developer.android.com/ndk/downloads/revision_history

        This was focused to deploy up-to-date libstdc++ as part of clang:
        https://developer.android.com/ndk/guides/cpp-support#libc

        Relying on the deprecated gcc disables modern C++ usage like C++17, C++14 or parts of C++11. This is a no-go for current software development. So an specific bug has to be filed to work correctly with non deprecated compilers.

        P 1 Reply Last reply 26 Sept 2018, 13:27
        0
        • C cguenther 0
          26 Sept 2018, 13:19

          I hardly vote that this thread isn't solved. Relying on a deprecated implementation is not a solution:
          Even with Android NDK r17 the gcc part was depricated:
          https://github.com/android-ndk/ndk/wiki/Changelog-r17

          The current release removed the deprecated gcc:
          https://developer.android.com/ndk/downloads/revision_history

          This was focused to deploy up-to-date libstdc++ as part of clang:
          https://developer.android.com/ndk/guides/cpp-support#libc

          Relying on the deprecated gcc disables modern C++ usage like C++17, C++14 or parts of C++11. This is a no-go for current software development. So an specific bug has to be filed to work correctly with non deprecated compilers.

          P Offline
          P Offline
          Pablo J. Rogina
          wrote on 26 Sept 2018, 13:27 last edited by
          #9

          @cguenther-0 said in Qt + Android problem:

          So an specific bug has to be filed to work correctly with non deprecated compilers.

          You are more than welcome to file such a bug. Whenever you have the ticket number, you can update this post for further reference. Thanks

          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
          • V Offline
            V Offline
            vlada
            wrote on 27 Sept 2018, 16:46 last edited by
            #10

            I just run into this problem too. The bug report was already created in May but was unfortunately closed as invalid.

            Unfortunately the Android port of Qt is very poorly maintained. There is a lot of annoying bugs that nobody cares about. With each new version of Qt one problem is fixed and two new appear. :-(

            1 Reply Last reply
            1
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 27 Sept 2018, 19:50 last edited by
              #11

              @vlada What you might be ignoring is that the Android NDK releases are a real pain as its developers are changing things here and there breaking workflow if not compilation. It's for a reason that r10e has stayed the reference for so long. Most of the releases in between have broken stuff one way or another and that's outside of Qt. IIRC r17 is the first that can be used since r10e.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              V 1 Reply Last reply 30 Sept 2018, 08:42
              1
              • S SGaist
                27 Sept 2018, 19:50

                @vlada What you might be ignoring is that the Android NDK releases are a real pain as its developers are changing things here and there breaking workflow if not compilation. It's for a reason that r10e has stayed the reference for so long. Most of the releases in between have broken stuff one way or another and that's outside of Qt. IIRC r17 is the first that can be used since r10e.

                V Offline
                V Offline
                vlada
                wrote on 30 Sept 2018, 08:42 last edited by
                #12

                @SGaist I know it is very difficult to keep up with all the changes Google is making to Android NDK. But sometimes it takes IMO too much time to fix the problems. I'm using the r17 and didn't run into any problems. Of course mith r18 Qt won't work at all because of the switch to Clang.

                1 Reply Last reply
                0
                • A amsantosr
                  21 Sept 2018, 20:51

                  @Pablo-J.-Rogina Solved! I tried with android-ndk-r17c and it worked. Thank you!

                  A Offline
                  A Offline
                  alberanid
                  wrote on 30 Sept 2018, 13:06 last edited by alberanid
                  #13

                  @amsantosr said in Qt + Android problem:

                  @Pablo-J.-Rogina Solved! I tried with android-ndk-r17c and it worked. Thank you!

                  Hi @amsantosr ,
                  I'm facing exactly the same problem, but I have problems also with r17c.

                  Could you provide the complete configure options you have used?

                  Which Android platform version are you using? (I need 26, and the device is armeabi-v7a)

                  Thanks in advance!

                  The error I get:

                  Checking for target architecture... 
                  + cd /build/users/davide/git/qt5-sources/config.tests/arch && /build/users/davide/git/qt5-sources/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console s
                  ingle_arch" "QMAKE_CFLAGS += --sysroot=/build/users/davide/android/ndk/android-ndk-r17c/platforms/android-26/arch-arm" "QMAKE_CXXFLAGS += --sysroot=/build/users/davide/android/ndk/android-ndk-r17c/platforms
                  /android-26/arch-arm" "QMAKE_LFLAGS += --sysroot=/build/users/davide/android/ndk/android-ndk-r17c/platforms/android-26/arch-arm" -early "CONFIG += cross_compile" /build/users/davide/git/qt5-sources/qtbase/c
                  onfig.tests/arch
                  + cd /build/users/davide/git/qt5-sources/config.tests/arch && MAKEFLAGS= /usr/bin/make
                  > /build/users/davide/android/ndk/android-ndk-r17c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -c -D__ANDROID_API__=26 --sysroot=/build/users/davide/android/ndk/
                  android-ndk-r17c/sysroot -isystem /build/users/davide/android/ndk/android-ndk-r17c/sysroot/usr/include/arm-linux-androideabi -isystem /build/users/davide/android/ndk/android-ndk-r17c/sources/cxx-stl/gnu-lib
                  stdc++/4.9/include -isystem /build/users/davide/android/ndk/android-ndk-r17c/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -
                  mfpu=vfp -fno-builtin-memmove --sysroot=/build/users/davide/android/ndk/android-ndk-r17c/platforms/android-26/arch-arm -mthumb -Os -std=gnu++11 -fPIC  -I/build/users/davide/git/qt5-sources/qtbase/config.tes
                  ts/arch -I. -I/build/users/davide/git/qt5-sources/qtbase/mkspecs/android-g++ -o arch.o /build/users/davide/git/qt5-sources/qtbase/config.tests/arch/arch.cpp
                  > /build/users/davide/git/qt5-sources/qtbase/config.tests/arch/arch.cpp:43:19: fatal error: stdio.h: No such file or directory
                  >  #include <stdio.h>
                  >                    ^
                  > compilation terminated.
                  > Makefile:177: recipe for target 'arch.o' failed
                  > make: *** [arch.o] Error 1
                  Project ERROR: Could not determine target architecture. See config.log for details.
                  

                  My configure args:

                  ./configure \
                          -xplatform android-g++ \
                          --disable-rpath \
                          -sysroot $HOME/android/ndk/android-ndk-r17c/platforms/android-26/arch-arm \
                          -android-ndk $HOME/android/ndk/android-ndk-r17c \
                          -android-sdk ~/android/sdk \
                          -android-ndk-host linux-x86_64 \
                          -android-ndk-platform android-26 \
                          -android-toolchain-version 4.9 \
                          -android-arch armeabi-v7a \
                          --prefix=./out \
                          -nomake examples \
                          -nomake tests \
                          -skip qt3d \
                          -skip qtactiveqt \
                          -skip qtcanvas3d \
                          -skip qtcharts \
                          -skip qtdatavis3d \
                          -skip qtdeclarative \
                          -skip qtdoc \
                          -skip qtdocgallery \
                          -skip qtgamepad \
                          -skip qtgraphicaleffects \
                          -skip qtmacextras \
                          -skip qtpurchasing \
                          -skip qtqa \
                          -skip qtquickcontrols \
                          -skip qtquickcontrols2 \
                          -skip qtrepotools \
                          -skip qtscript \
                          -skip qtscxml \
                          -skip qtserialport \
                          -skip qttranslations \
                          -skip qtwayland  \
                          -skip qtwebengine \
                          -skip qtwebglplugin \
                          -skip qtwebview \
                          -skip qtwinextras \
                          -skip qtx11extras \
                          -no-warnings-are-errors \
                          -opensource \
                          -confirm-license \
                          -verbose
                  
                  1 Reply Last reply
                  0
                  • V Offline
                    V Offline
                    vlada
                    wrote on 1 Oct 2018, 13:07 last edited by
                    #14

                    A similar problem was described here. I hope it might help you.

                    However it works on my computer with Android-NDK R17, Qt 5.10 and 5.11, Java SDK 8 and latest Android SDK (API 28, Gradle 4.4, have some problems with 4.6).

                    I have the missing header file is in this directory: ..\ndk-bundle\sources\cxx-stl\gnu-libstdc++\4.9\include\tr1\stdio.h

                    But the problem doesn't seem to be in the header file. The make process complains that target architecture was not defined. I would look towards this direction for the problem.

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      AlfredoC
                      wrote on 8 Nov 2018, 19:28 last edited by
                      #15

                      Hi,

                      I have a similar problem.
                      Starting qtcreator I get an error:

                      clang++: error: unknown argument: '-mthumb-interwork'
                      

                      Trying to compile an app for android i got this error:

                      Project ERROR: failed to parse default search paths from compiler output
                      

                      and this error:

                      Fehler beim Auswerten der Datei myProjekt.pro. 
                      

                      in english: Error when evaluating the file myProjekt.pro.

                      I think the problem is the clang error. But I have no idea where it comes from.
                      When I compile the same code as a desktop app there is no error.
                      I have the same configuration as shown above from @amsantosr

                      Any ideas?

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 8 Nov 2018, 20:28 last edited by
                        #16

                        Hi,

                        You are likely using ndk18 which is not yet support (but almost) so currently as already suggested earlier in this thread use a prior version of it.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        1
                        • A Offline
                          A Offline
                          AlfredoC
                          wrote on 12 Nov 2018, 15:25 last edited by
                          #17

                          @SGaist : you where right, I changed to ndk 17c and it works :-)
                          Thanks!

                          1 Reply Last reply
                          2

                          • Login

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