Question

I am trying to run my first Qt Android application and I followed this tutorial:

http://urfoex.blogspot.ro/2013/12/qt5-android-setting-up-qt-52-for-android.html

However, after I ran it i got this error:

i686-linux-android-g++: error: unrecognized command line option '-marm' make: *** 
[main.o] Error 1 21:33:42: The process "make" exited with code 2.
Error while building/deploying project avd_tests (kit: Android for x86 (GCC 4.8, Qt 5.2.1)) When executing step 'Make'

I also tried using armeabi but i got:

In file included from ../.android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/include/algorithm:60:0,
                 from ../.Qt5.2.1/5.2.1/android_armv7/include/QtCore/qglobal.h:82,
                 from ../.Qt5.2.1/5.2.1/android_armv7/include/QtCore/qcoreapplication.h:45,
                 from ../.Qt5.2.1/5.2.1/android_armv7/include/QtWidgets/qapplication.h:45,
                 from ../.Qt5.2.1/5.2.1/android_armv7/include/QtWidgets/QApplication:1,
                 from ../avd_tests/qtquick2controlsapplicationviewer/qtquick2controlsapplicationviewer.h:13,
                 from ../avd_tests/main.cpp:1: ../.android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/include/utility:68:28: fatal error: bits/c++config.h: No such file or directory  #include <bits/c++config.h>
                            ^ compilation terminated. make: *** [main.o] Error 1 21:44:14: The process "make" exited with code 2. Error while building/deploying project avd_tests (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.2.1)) When executing step 'Make'

The application I am building is a default Qt Quick application. I am using Qt 5.2.1 and QtCreator 3.0.1.

Anyone any Idea what it could be or does anyone know a good guide on how to make Qt on Android work on GNU/Linux?

Was it helpful?

Solution

It turns out it was a known bug in the newer version of Android SDK.

As pointed by Bogdan Vatra, the creator of Qt for Android, the solutions were:

  • Find an older Android SDK.
  • Upgrade your Qt creator (use Qt SDK 5.3)
  • Use a real device.

In order to solve the problem I downloaded qt-opensource-linux-x64-android-5.3.0-RC_2014-04-14_00-48-35-55.run from http://download.qt-project.org/snapshots/qt/5.3/5.3.0-RC/2014-04-14_55/ and the deploy worked successfully!

Thanks Bogdan!

OTHER TIPS

You should download and install Qt 5.2.1 for Android (Linux 32-bit or 64-bit) from here. Qt Project’s SDK is not coming with Android SDK/NDK so you must download and install them yourself from here. You’ll need Android NDK (ver. r9+) and SDK (ver. 22+).

If you don’t plan to create Android Java apps, then make sure you are downloading ONLY the SDK and not ADT Bundle or Android Studio.

After downloading extract them. For Android SDK you should have a connection to Internet and download the desired tools. you have to install at least Android API-13! You also must install Android SDK Platform-tools and Android SDK Build-tools.

Open Qt Creator. Goto Tools->Option->Android settings page and set Android SDK and NDK locations.

You can find a detailed tutorial Here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top