Android NDK: No such file or directory



  • Hello all -

    I have been struggling with the following problem for several days. I have a project that is working great on desktop and a custom embedded device, but when I attempt to compile for Android I get the following error:

    /usr/bin/sh: C:android-ndk-r10e-windows-x86_64android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++: No such file or directory

    The NDK does exist at that location. I have tried moving the NDK to different locations, and several versions of the NDK with the same results.

    Any help would be appreciated!


  • Moderators

    @Tenuki

    Hi and welcome to devnet forum

    You have a relative path there. On the very left it says

    C:android-ndk-r10e-windows-x86_64android-ndk-r10e
    

    in order to have an absolute path you need to have:

    C:/android-ndk-r10e-windows-x86_64android-ndk-r10e
    


  • I have noticed that, and I can't figure out why it outputs like that.
    My Android NDK location is listed as: C:\android-ndk-r10e-windows-x86_64\android-ndk-r10e


  • Moderators

    @Tenuki

    When you are working with Qt creator you entered under "Tools"->"Options"->"Devices" and the Android tab for NDK:

    C:\android-ndk-r10e-windows-x86_64\android-ndk-r10e
    

    This should work. It should give there already a warning when the content is not correct. There is a button to the right, I believe I have chosen the folder through that dialog.

    You can also post the content of the output pane.



  • @koahnig said in Android NDK: No such file or directory:

    @Tenuki

    When you are working with Qt creator you entered under "Tools"->"Options"->"Devices" and the Android tab for NDK:

    C:\android-ndk-r10e-windows-x86_64\android-ndk-r10e
    

    This should work. It should give there already a warning when the content is not correct. There is a button to the right, I believe I have chosen the folder through that dialog.

    You can also post the content of the output pane.

    That is correct. I selected the correct folder through the file dialog.

    My Current Android setup in QtCreator


  • Moderators

    @Tenuki

    That looks fine. The only thing missing is a selection for an AVD. However, I am not sure, if this makes a difference.

    Please post the content of "4 Compile Output" pane. At least the section around the error message.



  • 11:04:40: Starting: "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" 
    cd src/ && ( test -e Makefile || C:/Qt/5.8/android_armv7/bin/qmake.exe -o Makefile C:/Solstice/Dev/src/src.pro -spec android-g++ CONFIG+=debug CONFIG+=qml_debug 'BASE_CONFIG_DIR=C:\Source\CommercialUI\UI\LCAP-EQ\Dev\Config' ) && C:/Qt/Tools/mingw530_32/bin/mingw32-make -f Makefile 
    mingw32-make[1]: Entering directory 'C:/Builds/Solstice/android-g++/debug/src'
    cd 3rdparty/ && ( test -e Makefile || C:/Qt/5.8/android_armv7/bin/qmake.exe -o Makefile C:/Solstice/Dev/src/3rdparty/3rdparty.pro -spec android-g++ CONFIG+=debug CONFIG+=qml_debug 'BASE_CONFIG_DIR=C:\Source\CommercialUI\UI\LCAP-EQ\Dev\Config' ) && C:/Qt/Tools/mingw530_32/bin/mingw32-make -f Makefile 
    mingw32-make[2]: Entering directory 'C:/Builds/Solstice/android-g++/debug/src/3rdparty'
    cd pugixml/ && ( test -e Makefile || C:/Qt/5.8/android_armv7/bin/qmake.exe -o Makefile C:/Solstice/Dev/src/3rdparty/pugixml/pugixml.pro -spec android-g++ CONFIG+=debug CONFIG+=qml_debug 'BASE_CONFIG_DIR=C:\Source\CommercialUI\UI\LCAP-EQ\Dev\Config' ) && C:/Qt/Tools/mingw530_32/bin/mingw32-make -f Makefile 
    mingw32-make[3]: Entering directory 'C:/Builds/Solstice/android-g++/debug/src/3rdparty/pugixml'
    C:/Qt/Tools/mingw530_32/bin/mingw32-make -f Makefile.Debug
    mingw32-make[4]: Entering directory 'C:/Builds/Solstice/android-g++/debug/src/3rdparty/pugixml'
    C:\android-ndk-r10e-windows-x86_64\android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ -c -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove --sysroot=C:\android-ndk-r10e-windows-x86_64\android-ndk-r10e/platforms/android-16/arch-arm/ -g -g -marm -O0 -fPIC -std=gnu++11 -Wall -W -D_REENTRANT -DVERSION_MAJOR=2 -DVERSION_MINOR=0 -DVERSION_PATCH=0 -DVERSION_DEV="\"kgray1d\"" -DVERSION_XSPEC="\"android-g++\"" -DQT_QML_DEBUG -DQT_CORE_LIB -IC:/Solstice/Dev/src/3rdparty/pugixml -I. -IC:/Qt/5.8/android_armv7/include -IC:/Qt/5.8/android_armv7/include/QtCore -Idebug -isystem C:/android-ndk-r10e-windows-x86_64/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem C:/android-ndk-r10e-windows-x86_64/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -isystem C:/android-ndk-r10e-windows-x86_64/android-ndk-r10e/platforms/android-16/arch-arm/usr/include -IC:/Qt/5.8/android_armv7/mkspecs/android-g++ -o debug/pugixml.obj C:/Solstice/Dev/src/3rdparty/pugixml/src/pugixml.cpp
    /usr/bin/sh: C:android-ndk-r10e-windows-x86_64android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++: No such file or directory
    Makefile.Debug:135: recipe for target 'debug/pugixml.obj' failed
    mingw32-make[4]: *** [debug/pugixml.obj] Error 127
    mingw32-make[4]: Leaving directory 'C:/Builds/Solstice/android-g++/debug/src/3rdparty/pugixml'
    Makefile:38: recipe for target 'debug' failed
    mingw32-make[3]: Leaving directory 'C:/Builds/Solstice/android-g++/debug/src/3rdparty/pugixml'
    mingw32-make[3]: *** [debug] Error 2
    Makefile:43: recipe for target 'sub-pugixml-make_first' failed
    mingw32-make[2]: *** [sub-pugixml-make_first] Error 2
    mingw32-make[2]: Leaving directory 'C:/Builds/Solstice/android-g++/debug/src/3rdparty'
    Makefile:45: recipe for target 'sub-3rdparty-lib-make_first' failed
    mingw32-make[1]: Leaving directory 'C:/Builds/Solstice/android-g++/debug/src'
    mingw32-make[1]: *** [sub-3rdparty-lib-make_first] Error 2
    Makefile:42: recipe for target 'sub-src-make_first' failed
    mingw32-make: *** [sub-src-make_first] Error 2
    11:04:44: The process "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project solstice (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.8.0 for Android armv7))
    When executing step "Make"
    11:04:44: Elapsed time: 00:21.
    

  • Moderators

    @Tenuki said in Android NDK: No such file or directory:

    Makefile.Debug:135: recipe for target 'debug/pugixml.obj' failed

    What is with that line?

    It looks like a source file is missing in that and the compiler complains about it.
    Rerun qmake and a rebuild

    Also check if there is a source file in the location 'C:/Builds/Solstice/android-g++/debug/src/3rdparty/pugixml'

    What are you compiling? Is this an example?



  • The clue is "/usr/bin/sh". Sounds like the build system thinks that the OS is Linux. There is no /usr/bin anything in Windows.

    Could be the same thing as in
    https://forum.qt.io/topic/74378/mingw32-make-install_target-make-e-2-the-system-cannot-find-the-file-specified-windows-10-android


  • Moderators

    @mvuori

    You might be right, but I cannot confirm with my setup.

    I have started with Android setup recently myself and found a couple of strange things.

    My recommendation is at the moment to go straight for the last version of Qt 5.9 with the latest Qt creator. Together with the Android studio and its SDK I could get it to work. One thing for sure, you have already the correct version of NDK. The most recent NDK version r14 is not yet compatible with the rest of the new Qt stuff.

    I did create a hello world app with Android studio to show that that part is working. Then I checked out some of Qt examples. There are some dedicated ones. Then I made a Qt GUI application from a template through creator. For me those different steps helped me get to a stage of compiling my real stuff. Sometimes a diversion helps.



  • @mvuori said in Android NDK: No such file or directory:

    The clue is "/usr/bin/sh". Sounds like the build system thinks that the OS is Linux. There is no /usr/bin anything in Windows.

    Could be the same thing as in
    https://forum.qt.io/topic/74378/mingw32-make-install_target-make-e-2-the-system-cannot-find-the-file-specified-windows-10-android

    I was just assuming that this is referring to android's linux kernel. I don't know of any way to change the operating system, its pretty much set by the install package you download.

    @koahnig said in Android NDK: No such file or directory:

    @mvuori

    You might be right, but I cannot confirm with my setup.

    I have started with Android setup recently myself and found a couple of strange things.

    My recommendation is at the moment to go straight for the last version of Qt 5.9 with the latest Qt creator. Together with the Android studio and its SDK I could get it to work. One thing for sure, you have already the correct version of NDK. The most recent NDK version r14 is not yet compatible with the rest of the new Qt stuff.

    I did create a hello world app with Android studio to show that that part is working. Then I checked out some of Qt examples. There are some dedicated ones. Then I made a Qt GUI application from a template through creator. For me those different steps helped me get to a stage of compiling my real stuff. Sometimes a diversion helps.

    I have reinstalled Qt in a new directory, set up my builds again, and I still get the same problem.


  • Moderators

    @Tenuki

    Did you try some basic "Hello world" app?
    This tells you at least that the installation is ok.

    What kind of source is there? Is it c++?


Log in to reply
 

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