Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QNetworkAccessManager not work in Android



  • Hi!
    QNetworkAccessManager not work in Android, but in the Windows normal works.
    How can I fix this?
    I get errors:

    W Qt A11Y : Could not activate platform accessibility.
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve OPENSSL_init_ssl
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve OPENSSL_init_crypto
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve ASN1_STRING_get0_data
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve EVP_CIPHER_CTX_reset
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve EVP_PKEY_base_id
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve RSA_bits
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_new_null
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_push
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_free
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_num
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_pop_free
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve OPENSSL_sk_value
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve DH_get0_pqg
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_ciphersuites
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve SSL_set_psk_use_session_callback
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve SSL_get_client_random
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve SSL_SESSION_get_master_key
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve TLS_client_method
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve TLS_server_method
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve X509_STORE_CTX_get0_chain
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve X509_getm_notBefore
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve X509_getm_notAfter
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve X509_get_version
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve X509_STORE_set_ex_data
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve X509_STORE_get_ex_data
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve CRYPTO_free
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve OpenSSL_version_num
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket: cannot resolve OpenSSL_version
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: Incompatible version of OpenSSL
    W libgameAndWebView_armeabi-v7a.so: qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
    

  • Lifetime Qt Champion

    @Mikeeeeee You're trying to access HTTPS URLs and do not have OpenSSL libs



  • The computer has OpenSSL, but for some reason it does not participate in compilation. How can I fix this?



  • @Mikeeeeee ,
    Try follow this bro:
    https://github.com/KDAB/android_openssl
    It worked for me.



  • iIt is not work. I use qt 5.14, maybe that's why it doesn't work?


  • Lifetime Qt Champion

    @Mikeeeeee You need OpenSSL for Android and deploy it together with your app to Android device.



  • I use qt 5.14 too, just clone it and include *.pri file inside your pro file.



  • What permission do I need to add in the manifest?



  • @Quang-Phu I tried it, but it doesn't work for me for some reason. Could it be something else?


Log in to reply