Select to view content in your preferred language

Announcement for Qt developers targeting Android 6.0

2974
3
08-12-2016 03:54 PM
Labels (1)
LucasDanzinger
Esri Frequent Contributor
0 3 2,974

Starting with Android 6 (marshmallow), Google has moved away from OpenSSL to their own SSL implementation called BoringSSL. This affects all Qt developers targeting Android 6 and later, as libssl.so and libcrypto.so are no longer available from Android, causing https requests to fail in Qt applications. The solution suggested at this time by The Qt Company is to compile these libraries and package them in the APK with the ANDROID_EXTRA_LIBS qmake variable. For example, you could build the two libraries from OpenSSL, copy them into your Android kit’s lib folder, and then add the following line to your project's *.pro file:


android {
    ANDROID_LIBS = $$dirname(QMAKE_QMAKE)/../lib
    
    ANDROID_EXTRA_LIBS += \
        $$ANDROID_LIBS/libssl.so \
        $$ANDROID_LIBS/libcrypto.so
} 

This suggestion is applicable to any Qt developer targeting Android 6, whether using ArcGIS Runtime for Qt or not. Therefore, if you are using ArcGIS Runtime SDK for Qt, this suggestion is applicable whether you are using 10.2.5, 10.2.6, or Quartz (which is currently in beta). See the Qt documentation for further details on how to build OpenSSL and integrate the binaries into your project. In addition, licensing requirements for OpenSSL can be reviewed at https://www.openssl.org/docs/faq.html#LEGAL1  and https://www.openssl.org/source/license.html.

3 Comments
tanerkoka1
Deactivated User

Hi Lucas ,

We are using Windows development environment and Arcgis Runtime SDK for Qt 10.2.6 and Qt 5.4.2 (MSVC 2013, 32 bit) Qt Creator QT\QML side. And we are develop and deploy Adroid app with Android Armeobi-v7a (GCC4.9 , QT 5.4.2) kid.

We have Galaxy Tab 2 and our application is correct working (wcf login services wich use "https requests") in Android Operating System 5.0.2 Version but when I update My Android OS to 6.0.1 and then when I tried to use wcf (login) services gives exception .

 Can I sent our sample App example to you for fix this settings in our sample application ? Because I have not been able o do this hard work.I did not fully understand solution because we are using Windows development environment .Can you help me ?

We are using below code (in Main) for passing certificate:

QSslConfiguration config = QSslConfiguration::defaultConfiguration();
config.setPeerVerifyMode(QSslSocket::VerifyNone);
QSslConfiguration::setDefaultConfiguration(config);

Here is also our exception console output below;

D MenuDenemeNumarataj: (null):0 ((null)): int main(int, char**) ApplicationWindow_QMLTYPE_165_QML_191(0x9bbe2460)
D mali_winsys: new_window_surface returns 0x3000, [1536x2000]-format:1
D libGLESv2: DTS_GLAPI : DTS is not allowed for Package : com.mycompany.myappname
D ViewRootImpl: ViewPostImeInputStage processPointer 0
D ViewRootImpl: ViewPostImeInputStage processPointer 1
F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x8 in tid 20871 (QtThread)

How Can I solve this problem ?

Best Regards

tanerkoka1
Deactivated User

Hi Lucas ,

We are find how to solve  OpenSSL if running into errors from Android 6: http://doc.qt.io/qt-5/opensslsupport.html in this link from QT Forum but we can't solve in Windows OS.

Are there any source example to solve in Windows OS this problem ?

We are using Arcgis Runtime SDK for Qt 10.2.6 and Qt 5.4.2 (MSVC 2013, 32 bit) Qt Creator QT\QML side. And we are develop and deploy Adroid app with **Android Armeobi-v7a (GCC4.9 , QT 5.4.2) ** kid on Windows Operating System. So this is important problem with us .Can you get help from your QT team ? Or can I sent my app to you  to solve this OpenSSL problem in Windows then sent to me correct app wich works without ssl errors because I can not solve this problem for long time in Windows side ?

LucasDanzinger
Esri Frequent Contributor

Taner-

You should be able to build for arm android on windows or unix systems. Either way, as this issue is with Qt itself, this would be a great question to post on the Qt Forums or to submit to the Qt Company support team. 

Thanks,

Luke

About the Author
I'm a Geographer working in Product Development at Esri, focusing my time on the ArcGIS Runtime SDKs. I'm an Esri Certified ArcGIS Desktop Professional (10 years experience working with ArcGIS) with a wide range of technical skills including native application development, spatial databases, desktop/web GIS, and scripting. My Master's degree is in GIS with a focus in Natural Resource Management. Currently, I'm most interested in building cross-platform and lightweight apps using our ArcGIS Runtime SDK for Qt.