Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Running on android



  • I have been trying to run qt on my androd phone, but been running into a lot of problems, I have downloaded the prerequisites as instructed but this does not seem to solve anything. I started trying to run examples instead incase the fault was from my own code, but the following is what appears in my general message tab:

    Maybe you forgot to setup the environment?
    Error while parsing file C:\Qt\Examples\Qt-5.12.2\widgets\widgets\analogclock\analogclock.pro. Giving up.
    Project ERROR: Cannot run target compiler 'C:\Users\emiol\OneDrive\Desktop\C++\android-ndk-r10e/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++'. Output:
    ===================
    ===================
    Maybe you forgot to setup the environment?
    Error while parsing file C:\Qt\Examples\Qt-5.12.2\widgets\widgets\analogclock\analogclock.pro. Giving up.
    Project ERROR: Cannot run target compiler 'C:\Users\emiol\OneDrive\Desktop\C++\android-ndk-r10e/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++'. Output:
    ===================
    ===================
    Maybe you forgot to setup the environment?
    Error while parsing file C:\Qt\Examples\Qt-5.12.2\widgets\widgets\analogclock\analogclock.pro. Giving up.
    Project ERROR: Cannot run target compiler 'C:\Users\emiol\OneDrive\Desktop\C++\android-ndk-r10e/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++'. Output:
    ===================
    ===================
    Maybe you forgot to setup the environment?
    Error while parsing file C:\Qt\Examples\Qt-5.12.2\widgets\widgets\analogclock\analogclock.pro. Giving up.
    Project ERROR: Cannot run target compiler 'C:\Users\emiol\OneDrive\Desktop\C++\android-ndk-r10e/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++'. Output:
    ===================
    ===================
    Maybe you forgot to setup the environment?
    Error while parsing file C:\Qt\Examples\Qt-5.12.2\widgets\widgets\analogclock\analogclock.pro. Giving up.
    Project ERROR: Cannot run compiler 'cl'. Output:
    ===================
    ===================
    Maybe you forgot to setup the environment?
    Error while parsing file C:\Qt\Examples\Qt-5.12.2\widgets\widgets\tetrix\tetrix.pro. Giving up.
    Project ERROR: Cannot run target compiler 'C:\Users\emiol\OneDrive\Desktop\C++\android-ndk-r10e/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++'. Output:
    ===================
    ===================
    Maybe you forgot to setup the environment?
    Error while parsing file C:\Qt\Examples\Qt-5.12.2\widgets\widgets\tetrix\tetrix.pro. Giving up.
    Project ERROR: Cannot run target compiler 'C:\Users\emiol\OneDrive\Desktop\C++\android-ndk-r10e/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++'. Output:
    ===================
    ===================
    Maybe you forgot to setup the environment?
    Error while parsing file C:\Qt\Examples\Qt-5.12.2\widgets\widgets\tetrix\tetrix.pro. Giving up.
    

    Can someone put me through please?


  • Lifetime Qt Champion

    @Abdulmueez As stated here: https://doc.qt.io/qt-5/android-getting-started.html starting with Qt 5.12 you should use a NDK newer than r10e. So, I suggest to install newer NDK. Starting with Qt 5.12 CLang instead of GCC is required which provided with newer NDKs.



  • I have installed the latest version and now while trying to run on my android phone, I get these 2 errors
    :-1: error: error: cannot find -lc++
    :-1: error: linker command failed with exit code 1 (use -v to see invocation)


  • Lifetime Qt Champion

    @Abdulmueez Delete build folder, run qmake and rebuild



  • The errors don't go away after applying the recommended changes.



  • 2019-07-09T11:10:18 Clang Code Model: Error: The clangbackend executable "C:\Qt\Tools\QtCreator\bin\clangbackend.exe" could not be started (timeout after 10000ms).
    Running Windows Runtime device detection.
    C:/Qt/5.12.2/winrt_armv7_msvc2015/bin/winrtrunner.exe --list-devices
    Running Windows Runtime device detection.
    C:/Qt/5.12.2/winrt_armv7_msvc2015/bin/winrtrunner.exe --list-devices
    Running Windows Runtime device detection.
    C:/Qt/5.12.2/winrt_armv7_msvc2015/bin/winrtrunner.exe --list-devices
    Found 1 Windows Runtime devices.
    Found 1 Windows Runtime devices.
    Found 1 Windows Runtime devices.
    Project ERROR: Cannot run compiler 'cl'. Output:

    ===================
    Maybe you forgot to setup the environment?
    Error while parsing file C:\Qt\Examples\Qt-5.12.2\quick\positioners\positioners.pro. Giving up.
    I have the above message in my general message tab


  • Lifetime Qt Champion

    Hi,

    Why are you trying to compile for WinRT since you want your application to run on Android ?

    Also, cl missing usually means that you don't have Visual Studio installed for C++.



  • Hmm, I have visual studio installed already, and about compiling for winrt, all I do is click on the compile for android v7a... and then click on run.
    Isn't that the right step to follow.


  • Lifetime Qt Champion

    Did you install all the tools needed for Android development ? Like the SDK and NDK ?



  • 0_1562706163820_Screenshot (20).png
    Yes, I have them both installed.


  • Lifetime Qt Champion

    Then either you are currently using the wrong Kit or you modified one. The build logs shows that you are trying to build your application with the 64bit Visual Studio 2015 build of Qt.



  • No, that's for something else.
    These are the messages generated in the issues, general messages and compile output tab
    2_1562750362512_Screenshot (23).png 1_1562750362511_Screenshot (22).png 0_1562750362511_Screenshot (21).png.


  • Lifetime Qt Champion



  • I saw somewhere that ndk 20 is not compatible with Qt. (I can not remember where and why).
    It has same errors as you (linker error)
    Install ndk 19



  • Thanks a lot to everyone, after installing ndk 19, everything seems to work fine.


Log in to reply