JPEG support in Android
-
Hi,
Plugin not deployed ?
-
I have some more information.
I run androiddeployqt with --verbose option and it shows that libqjpeg.so is copied to *.apk:-- Copied /home/andrej/programovanie/build-trance-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_2-Release/android-build//libs/armeabi-v7a/libplugins_imageformats_libqjpeg.so
The file is also present in
bundled_in_lib
section of res/values/libs.xml.
However, at runtime the application output doesn't show any error loading the library. -
What do you get if you set QT_DEBUG_PLUGINS ?
-
I went back to older revisions of my code and realized that JPEG plugin was working before. By trying various revisions I was able to locate the change in code that prevented the plugin from loading. It was in my server communicator class:
class CServerCommunicator : public QObject { ... private: static QNetworkAccessManager *m_netManager; static QString m_sessionID; QNetworkReply *m_reply; };
This line in CServerCommunicator.cpp was actually the problem:
QNetworkAccessManager *CServerCommunicator::m_netManager = new QNetworkAccessManager();
Instead of static member m_netManager, I made a method which creates network manager as static local variable and returns its address. Now the JPEG plugin works fine on Android.
This is clearly some bug, so I will make a bug report from this.
-
Out of curiosity, why a static QNetworkAccessManager ?
-
You misunderstood that part. The doc says that one should be enough, not that you should only have one.