Can not build Android project in Windows 10



  • Im having problems trying to build a new android project in Qt. I created a new Qt Widget Application.
    When i try to compile the project i get this compile message:

    07:37:39: Running steps for project test...
    07:37:39: Starting: "D:\Coding\Qt\Tools\mingw530_32\bin\mingw32-make.exe" clean
    rm -f moc_MainWindow.cpp
    Makefile:409: recipe for target 'compiler_moc_header_clean' failed
    process_begin: CreateProcess(NULL, rm -f moc_MainWindow.cpp, ...) failed.
    make (e=2): The file can not be found.
    
    mingw32-make: [compiler_moc_header_clean] Error 2 (ignored)
    rm -f ui_MainWindow.h
    Makefile:822: recipe for target 'compiler_uic_clean' failed
    process_begin: CreateProcess(NULL, rm -f ui_MainWindow.h, ...) failed.
    make (e=2): The file can not be found.
    
    mingw32-make: [compiler_uic_clean] Error 2 (ignored)
    rm -f main.obj MainWindow.obj moc_MainWindow.obj
    Makefile:386: recipe for target 'clean' failed
    rm -f *~ core *.core
    process_begin: CreateProcess(NULL, rm -f main.obj MainWindow.obj moc_MainWindow.obj, ...) failed.
    make (e=2): The file can not be found.
    
    mingw32-make: [clean] Error 2 (ignored)
    07:37:39: The process "D:\Coding\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
    07:37:39: Configuration unchanged, skipping qmake step.
    07:37:39: Starting: "D:\Coding\Qt\Tools\mingw530_32\bin\mingw32-make.exe" 
    mingw32-make: Nothing to be done for 'first'.
    07:37:40: The process "D:\Coding\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
    07:37:40: Removing directory D:/Skrivbord/Project/build-test-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_1-Debug/android-build/libs
    07:37:40: Starting: "D:\Coding\Qt\Tools\mingw530_32\bin\mingw32-make.exe" "INSTALL_ROOT=D:/Skrivbord/Project/build-test-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_1-Debug/android-build" install
    
    cp -f libtest.so D:/Skrivbord/Project/build-test-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_1-Debug/android-build/libs/armeabi-v7a/libtest.so
    Makefile:1696: recipe for target 'install_target' failed
    process_begin: CreateProcess(NULL, cp -f libtest.so D:/Skrivbord/Project/build-test-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_1-Debug/android-build/libs/armeabi-v7a/libtest.so, ...) failed. make (e=2): The file can not be found.
    
    mingw32-make: [install_target] Error 2 (ignored)
    07:37:41: The process "D:\Coding\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
    07:37:41: Starting: "D:\Coding\Qt\5.7\android_armv7\bin\androiddeployqt.exe" --input D:/Skrivbord/Project/build-test-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_1-Debug/android-libtest.so-deployment-settings.json --output D:/Skrivbord/Project/build-test-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_1-Debug/android-build --deployment bundled --android-platform android-25 --jdk D:/Coding/Java/jdk1.8.0_112 --gradle
    
    Generating Android Package
     Input file: D:/Skrivbord/Project/build-test-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_1-Debug/android-libtest.so-deployment-settings.json
      Output directory: D:/Skrivbord/Project/build-test-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_1-Debug/android-build/
      Application binary: D:/Skrivbord/Project/build-test-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_1-Debug/libtest.so
      Android build platform: android-25
      Install to device: No
    Application binary is not in output directory: D:/Skrivbord/Project/build-test-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_1-Debug/android-build//libs/armeabi-v7a/libtest.so. Please run 'mingw32-make install INSTALL_ROOT=D:/Skrivbord/Project/build-test-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_1-Debug/android-build/' first.
    07:37:43: The process "D:\Coding\Qt\5.7\android_armv7\bin\androiddeployqt.exe" exited with code 7.
    Error while building/deploying project test (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.7.1))
    When executing step "Build Android APK"
    

    What am i doing wrong?

    Im using:
    Qt Creator 4.2.0
    Qt 5.7.1,
    Windows 10


  • Moderators

    @sailord
    you are using mingw compiler for building an android project?!
    Check your Android QtCreator settings. Escpeciall the NDK path.
    Also delete the .pro.user file (next to your .pro file) and restart QtCreator. Rerun qmake.



  • @raven-worx
    Tested your suggestion, did not work.

    I have the path correctly set up to the Apache ant,Android sdk, Android ndk & the java f folder:
    D:\Coding\apache-ant-1.10.0\bin\ant.bat
    D:\Coding\Android\sdk
    D:\Coding\Android\ndk
    D:\Coding\Java\jdk1.8.0_112

    In the build & run projects it is set up like this:

    qmake: qmake.exe Test.pro -spec android-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
    Make: mingw32-make.exe in D:\Skrivbord\Project\build-Test-Android_for_armeabi_v7a_GCC_4_9_....
    Make install
    Build Android APK





  • @mvuori
    Thanks that worked.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.