[Android-development] QNetworkAccessManager crashes by JNI-call (native Android) with Fatal signal 6 (SIGABRT)

Malek Khlif qt.malek.khlif at gmail.com
Fri Jun 10 15:58:16 CEST 2016


Hello,

I suppose that you use QNetworkAccessManager before that you create an
instance of QCoreApplication .

2016-06-10 15:53 GMT+02:00 Maik Ziemert <mail at moozoom.de>:

> I have a big problem with my Qt library - integrated in a native Android
> App over JNI.
>
>
> I wrote a static qt library. In this library I instantiate a
> QNetworkAccessManager for using a network communication:
>
>
> @QT CODE
>
> void SimpleQtLibrary::createNetworkManager()
> {
>
>         QNetworkAccessManager *manager = new QNetworkAccessManager(this);
>
>         <CRASH>
>
>         ...
>
>         return;
> }
>
> @QT CODE END
>
>
> I know, this async manager needs a own thread for internal signals.
>
>
> In my android project I will integrate this qt static library over jni:
>
>
> @JNI CODE
>
> #include <string.h>
> #include <jni.h>
> #include <android/log.h>
>
> #include <qtlibrary.h>
>
> static QtLibrary qtLib;
>
> extern "C" {
>         JNIEXPORT void JNICALL
> Java_com_company_qtlibrary_Interface_test(JNIEnv * env, jobject obj);
> };
>
> JNIEXPORT void JNICALL Java_com_company_qtlibrary_Interface_test(JNIEnv *
> env, jobject obj)
> {
>         qtLib.test();
>
>         return;
> }
>
> @JNI CODE END
>
>
> If I let running my android app, while the qt call over JNI, the app
> crashes:
>
> Fatal signal 6 (SIGABRT) at 0x000072f1 (code=-6), thread 29425
>
>
> How can I solve this problem? The QCoreApplication event loop works on the
> main thread (in Android), e.g. I can create a QTimer with a tick() every
> second.
>
>
> Please help me in this case. I dont know what I can do to find a goof
> solution.
>
>
> Thank you in advanced!
>
> _______________________________________________
> 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/20160610/21158aa7/attachment.html>


More information about the Android-development mailing list