Qt 5.4 & Android - compiler configuration



  • Hi there,

    I've just installed Qt 5.4 on my machine running Windows 7 and I cannot configure it to compile for android. I downloaded the JDK, Ant, the SDK as well as the NDK from their official websites, installed them all to C:\ and and set the paths in the options of the Qt Creator appropriately..

    !http://s16.postimg.org/y82xus0fp/Untitled2.png(Android SDK - installed packages)!
    !http://s16.postimg.org/sve3gncj9/Untitled1.png(Qt Creator - Configuration for Android)!

    First of all I tried to build the calendar example app for android and run it. The compilation failed and here's the compile output

    @
    04:10:51: Running steps for project calendar...
    04:10:51: Starting: "C:\Qt\5.4\android_armv7\bin\qmake.exe" C:\Qt\Examples\Qt-5.4\quick\controls\calendar\calendar.pro -r -spec android-g++ "CONFIG+=debug" "CONFIG+=declarative_debug" "CONFIG+=qml_debug"
    The system cannot find the path specified.
    04:10:53: The process "C:\Qt\5.4\android_armv7\bin\qmake.exe" exited normally.
    04:10:53: Starting: "C:\Qt\Tools\mingw491_32\bin\mingw32-make.exe"
    C:\android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ -c -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -std=gnu++0x -g -g -gdwarf-2 -marm -O0 -fno-omit-frame-pointer -Wall -Wno-psabi -W -D_REENTRANT -fPIE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_SQL_LIB -DQT_CORE_LIB -IC:\Qt\5.4\android_armv7\mkspecs\android-g++ -IC:\Qt\Examples\Qt-5.4\quick\controls\calendar -IC:\Qt\Examples\Qt-5.4\quick\controls\shared -IC:\Qt\5.4\android_armv7\include -IC:\Qt\5.4\android_armv7\include\QtQuick -IC:\Qt\5.4\android_armv7\include\QtWidgets -IC:\Qt\5.4\android_armv7\include\QtGui -IC:\Qt\5.4\android_armv7\include\QtQml -IC:\Qt\5.4\android_armv7\include\QtNetwork -IC:\Qt\5.4\android_armv7\include\QtSql -IC:\Qt\5.4\android_armv7\include\QtCore -I. -IC:\android-ndk-r10d\sources\cxx-stl\gnu-libstdc++\4.9\include -IC:\android-ndk-r10d\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a\include -IC:\android-ndk-r10d\platforms\android-9\arch-arm\usr\include -I. -o event.obj C:\Qt\Examples\Qt-5.4\quick\controls\calendar\src\event.cpp
    makefile:1392: recipe for target 'event.obj' failed
    process_begin: CreateProcess(NULL, C:\android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ -c -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -std=gnu++0x -g -g -gdwarf-2 -marm -O0 -fno-omit-frame-pointer -Wall -Wno-psabi -W -D_REENTRANT -fPIE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_SQL_LIB -DQT_CORE_LIB -IC:\Qt\5.4\android_armv7\mkspecs\android-g++ -IC:\Qt\Examples\Qt-5.4\quick\controls\calendar -IC:\Qt\Examples\Qt-5.4\quick\controls\shared -IC:\Qt\5.4\android_armv7\include -IC:\Qt\5.4\android_armv7\include\QtQuick -IC:\Qt\5.4\android_armv7\include\QtWidgets -IC:\Qt\5.4\android_armv7\include\QtGui -IC:\Qt\5.4\android_armv7\include\QtQml -IC:\Qt\5.4\android_armv7\include\QtNetwork -IC:\Qt\5.4\android_armv7\include\QtSql -IC:\Qt\5.4\android_armv7\include\QtCore -I. -IC:\android-ndk-r10d\sources\cxx-stl\gnu-libstdc++\4.9\include -IC:\android-ndk-r10d\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a\include -IC:\android-ndk-r10d\platforms\android-9\arch-arm\usr\include -I. -o event.obj C:\Qt\Examples\Qt-5.4\quick\controls\calendar\src\event.cpp, ...) failed.
    make (e=2): The system cannot find the file specified.

    mingw32-make: *** [event.obj] Error 2
    04:10:54: The process "C:\Qt\Tools\mingw491_32\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project calendar (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.4.0))
    When executing step "Make"
    04:10:54: Elapsed time: 00:03.
    @

    Then I noticed that what the Creator is trying to execute is:

    @
    C:\android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++
    @

    And I checked for that path and noticed that the path doesn't exist:

    !http://s22.postimg.org/5bt0yq041/Untitled3.png(prebuilt/windows-x86_64)!

    Later I checked the other toolchains, none of them contained a similar executable. I also checked the kits and saw the following:

    !http://s1.postimg.org/v9co24usf/Untitled.png(Build & Run - Kits)!

    Somehow I don't really understand what I could have done wrong... maybe someone could quickly help me out?

    Thank you!



  • Hey,, I have experienced the same problem, Its simply Qt 5.4 does not work with NDK rev 10 yet, so you need to use NDK 9 that all, because the structure of folders for NDK 10 is different than older editions !

    Regards.



  • [quote author="QLaith" date="1421583585"]Hey,, I have experienced the same problem, Its simply Qt 5.4 does not work with NDK rev 10 yet, so you need to use NDK 9 that all, because the structure of folders for NDK 10 is different than older editions !

    Regards.[/quote]

    Any ideas for when it will work with rev 10?



  • Why you need Rev 10, rev 9 is working pretty well, I have no idea but I guess it will be in Qt 5.5



  • [quote author="QLaith" date="1421868068"]Why you need Rev 10, rev 9 is working pretty well, I have not idea but I guess it will be in Qt 5.5[/quote]

    Just upgraded my linux system to Qt 5.4, rev 10 was pulled down automatically as well by my package management. Looks like i will have to revert back to rev 9....the joys of running bleeding edge :-)


  • Moderators

    It will be supported in either 5.4.1 (which has just branched out and should be available within 2-4 weeks), or 5.5 (IIRC, it is almost feature-frozen, so the release is still a long way away).


Log in to reply
 

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