Application builds fine with Qt 5.12.9 for Android. However fails with 5.15.1 on linking phase (compiles fine as deprecated Qt API was fixed). Building for
arm64-v8a ABI only:
qmake ANDROID_ABIS="arm64-v8a" ...
Have multiple link errors like this:
~/Qt/5.15.1/android/include/QtCore/qobjectdefs_impl.h:415: undefined reference to `operator delete(void*)' obj/QGCMapEngine.o: In function `QList<QString>::append(QString const&)': ~/Qt/5.15.1/android/include/QtCore/qlist.h:626: undefined reference to `__cxa_begin_catch' ~/Qt/5.15.1/android/include/QtCore/qlist.h:628: undefined reference to `__cxa_rethrow' ~/Qt/5.15.1/android/include/QtCore/qlist.h:629: undefined reference to `__cxa_end_catch' ~/Qt/5.15.1/android/include/QtCore/qlist.h:644: undefined reference to `__cxa_begin_catch' ~/Qt/5.15.1/android/include/QtCore/qlist.h:646: undefined reference to `__cxa_rethrow' ~/Qt/5.15.1/android/include/QtCore/qlist.h:647: undefined reference to `__cxa_end_catch'
Tried to fix
AndroidManifest.xml like mentioned here: Qt for Android known issues with no luck. Reproducible with latest Qt SDK installed and with Qt built from sources in docker. Any ideas what the problem is and how to fix?
- Full list of errors: qgroundcontrol#9136 (comment)
- Project: qgroundcontrol, branch: android_build_fix_qt5.15
Problem was in
-nostdlib++ hack fix in the following line: QGCCommon.pri#L60
QMAKE_LINK += -nostdlib++ # Hack fix
For 5.15 need to remove it and patch
AndroidManifest.xml to correctly build APK. This line could be removed for 5.12 as well as it was ndk20 problem while currently Qt Creator installs and uses ndk21 by default.