Important: Please read the Qt Code of Conduct -

"No rule to make target" error while building for Android

  • I am using Qt 5.2 and Qt Creator.I am trying to build a simple project for Android ,when I try to build an automatically-created widgets project,Qt Creator gives this error:

    @"06:56:53: The process "C:\Qt\Qt520\Tools\mingw48_32\bin\mingw32-make.exe" exited normally.

    06:56:53: Configuration unchanged, skipping qmake step.

    06:56:53: Starting: "C:\Qt\Qt520\Tools\mingw48_32\bin\mingw32-make.exe"

    C:\Qt\Qt520\5.2.0\android_armv7\bin\uic.exe ..\deneme5\mainwindow.ui -o ui_mainwindow.h

    mingw32-make: *** No rule to make target '............\downloads\AndroidNdk\android-ndk-r9b-windows-x86\android-ndk-r9b\sources\cxx-stl\gnu-libstdc++\4.8\libs\armeabi-v7a\include\bits\c++config.h', needed by 'main.obj'. Stop.

    06:56:54: The process "C:\Qt\Qt520\Tools\mingw48_32\bin\mingw32-make.exe" exited with code 2.

    Error while building/deploying project deneme5 (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.2.0))

    When executing step 'Make'9.06:56:54: Elapsed time: 00:02.@

    I have installed(or I think so) Android Sdk.When I run Android Sdk Manager it lists:

    Android Sdk Tools - Rev 22.3 - installed
    Android Sdk Platform-tools - Rev 19 - installed
    Android Sdk Build Tools - Rev 19 - installed

    Android 4.4(API 19):
    SDK Platform - Api:19 - Rev 1 - installed
    ARM EABI v7a System Image - Api:19 - Rev 1 - installed

    Android Support Library - Installed

    The other components aren't installed

    I downloaded ndk and extracted the files to a folder.
    I downloaded and extracted Apache Ants to a folder.
    I set a system variable called ANDROID_NDK_HOST : windows
    I have set JAVA_HOME system variable to point jdk directory.
    C:\Program Files\Java\jdk1.7.0_45

    I added these to Path variable : %ANT_HOME%\bin;%JAVA_HOME%\bin;<MINGW_ROOT>\bin;%P ATH%

    Inside Qt Creator,I added:
    Android SDK Location:C:\downloads\AndroidSdk\adt-bundle-windows-x86-20131030\adt-bundle-windows-x86-20131030\sdk

    Android NDK Location:C:\downloads\AndroidNdk\android-ndk-r9b-windows-x86\android-ndk-r9b

    It says:"Found 6 toolchains for this NDK."
    "Automatically create kits Android tool chains" is enabled.
    "Qt version for architecture mips is missing."

    Ant location:C:\downloads\ApacheAnt\apache-ant-1.9.2-bin\apache-ant-1.9.2\bin\ant.bat
    JDK location:C:\Program Files\Java\jdk1.7.0_45

    While I am creating a new project,I select only one of the Android ones on kit selection menu.

    Also I have another question too,do I have to connect an Android device to computer for building an Android application or not?

  • I solved the problem at last.

    It seems like the problem was ndk directory's long name:
    mingw32-make: *** No rule to make target '............\downloads\AndroidNdk\android-ndk-r9b-windows-x86\android-ndk-r9b\sources\cxx-stl\gnu-libstdc++\4.8\libs\armeabi-v7a\include\bits\c++config.h', needed by 'main.obj'. Stop.

    When I copied ndk directory to c:\android-ndk-r9b instead of c:\downloads\AndroidNdk\android-ndk-r9b-windows-x86\android-ndk-r9b ,and after setting the new path under Qt->Tools->Options->Android , it built the project without problems.

Log in to reply