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

Can't run Qt app on physical mobile device



  • Hi All,

    I am trying to build and run Qt app on andoid .seems likes it's building but I am not able to cheack it as it wont run . When I try to compile it , It compiles fine but when I try to run it , it wont run and I get this error:-

    Cannot find the android build step.
    Error while building/deploying project calqlatr (kit: Android for armeabi-v7a (GCC 4.9, Qt  (android_armv7)))
    When executing step "Deploy to Android device"
    

    I had also post this on stack-overflow . here is the link:- https://stackoverflow.com/questions/50434018/cant-run-android-app-in-qtcreator?noredirect=1#comment87888043_50434018

    I am new to qt and specially to android

    I am using arch Linux



  • I solved it by removing ~/.config/QtProject/ which deleted configuration and reinstalling qt for android using online installer . it seems like my installation was corrupted



  • @noone said in Can't run Qt app on physical mobile device:

    Error while building/deploying project calqlatr (kit: Android for armeabi-v7a (GCC 4.9, Qt (android_armv7)))
    When executing step "Deploy to Android device

    hey have you properly setup your Qt SDK, NDK and apache ant ?? . also if you compile your project the apk can also be found in build directory of your project .

    something like this
    /home/whatever_name/build-app-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_0_for_Android_armv7_c6c308-Release/android-build/bin/



  • I have set up everything including jdk,SDK and NDK. I have installed apache-ant by

    sudo pacman -S apache-ant
    

    Here is the screenshot:-

    alt text

    Also there is no android-build/bin folder in build directory :-

    here is what I all have in build directory :-

    % tree
    .
    ├── android-libcalqlatr.so-deployment-settings.json
    ├── libcalqlatr.so
    ├── main.o
    ├── Makefile
    ├── qrc_calqlatr.cpp
    ├── qrc_calqlatr.o
    ├── qrc_shared.cpp
    └── qrc_shared.o
    
    0 directories, 8 files
    

    Also I have setup all Android NDK environment variables.

    % cat /etc/environment 
    #
    # This file is parsed by pam_env module
    #
    # Syntax: simple "KEY=VAL" pairs on separate lines
    #
    JAVA_HOME=/usr/lib/jvm/default
    JRE_HOME=/usr/lib/jvm/default-runtime
    
    PATH=/home/jimbo/bin:/home/jimbo/.local/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/opt/cordova/bin:/opt/AndroidSDK/tools/bin:/opt/AndroidNDK
    
    QT_QPA_PLATFORMTHEME=qt5ct
    
    RUSTUP_HOME=/opt/Rust
    CARGO_HOME=/opt/Rust/.cargo
    PKG_CONFIG_PATH=/bin/pkg-config
    
    ANDROID_HOME=/opt/AndroidSDK
    
    ANDROID_NDK=/opt/AndroidNDK
    ANDROID_NDK_ROOT=/opt/AndroidNDK
    ANDROID_NDK_HOME=/opt/AndroidNDK
    


  • Also everything works under Android studio. I can build and create android apps and run them on my physical device in android studio



  • Did you activate the USB Debug mode in the physical phone?
    Do you have the phone drivers installed?



  • @Blaster

    @Blaster said in Can't run Qt app on physical mobile device:

    Did you activate the USB Debug mode in the physical phone?

    Yes.

    Do you have the phone drivers installed?

    No. Its runs perfectly with android studio .

    I also had armv7a emulator image which works in android studio. In qt-Creator , it didn't event ask me to run app in emulator .



  • i am not sure what's the problem but here is my setup and it works perfectly fine . Maybe you can try this one out :)

    1. using Qt5.10.0 ( offline installer)

    2. i have created a qt_android folder : all the SDK and NDK and apache ant resides here.
      0_1526997111352_1.png

    3. my qt creator settings
      0_1526997244370_2.png

    ..
    0_1526997255342_3.png

    1. also have you ran android sdk manager atleast once ?? to get the necessary tools .

    2. try to build a sample example provided by Qt itself .


  • Qt Champions 2020

    Hi, as I remember, I had same issue, see https://bugreports.qt.io/browse/QTCREATORBUG-20088 and I fixed that (see my link).



  • I solved it by removing ~/.config/QtProject/ which deleted configuration and reinstalling qt for android using online installer . it seems like my installation was corrupted


Log in to reply