[Android-development] Has anybody managed to get a Qt app built with clang/libc++ running on Android?

Лагнер, Сергей developer at lagner.ru
Thu Mar 15 05:56:36 CET 2018


Hello.

I use clang/libc++ to build my Qt application on android. It works well for
me but I use cmake and custom build scripts.

To find out the real reason of that I suggest you the following steps

1. Be sure that all you libraries need libc++, not gnustl_shared. You can
do that with readelf
> readelf -d -W libQt5Core.so | grep NEEDED
> readelf -d -W libYourLib.so | grep NEEDED

2. As I can see androiddeployqt do not support libc++ yet. If I am right,
you can find gnustl_shared in build_dir/android_install/res/values/libs.xml
file.
If so, you should replace it by c++_shared and replace libgnustl_shared.so
by libc++_shared.so in build_dir/android_install/libs/$arch/
Then rebuild gradle project.

Hope it helps.


2018-03-13 22:39 GMT+07:00 <policeterror at dyne.org>:

> Hello,
>
> gnustl is deprecated in latest NDK and C++11 is not working. Since I have
> a library dependency using C++11, I'm forced to upgrade to clang/libc++
>
> I've built Qt with clang/libc++, but I'm running into this error where my
> program crashes on startup with "your application  encountered a fatal
> error and cannot continue", and seeing this error in the application output:
>
> W System.err: Caused by: java.lang.UnsatisfiedLinkError: dlopen failed:
> library "libgnustl_shared.so" not found
>
> I've filed a bug which has been upgraded to P2: Important
>
> https://bugreports.qt.io/browse/QTBUG-67006
>
> Anybody have any solutions or workarounds for this?
>
> Thanks
> _______________________________________________
> Android-development mailing list
> Android-development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/android-development
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/android-development/attachments/20180315/00b4b96b/attachment.html>


More information about the Android-development mailing list