安卓 7.0 Qt 5.8 网络模块不能正常工作



  • 当发出网络请求时,就会闪退

    @jcy @MidoriYakumo

    日志如下:

    W linker  : library "libcrypto.so" ("/system/lib/libcrypto.so") needed or dlopened by "/data/app/org.qtproject.example.bitcoinworld_wallet_admin-1/lib/arm/libQt5Core.so" is not accessible for the namespace "classloader-namespace" - the access is temporarily granted as a workaround for http://b/26394120, note that the access will be removed in future releases of Android.
    W linker  : library "libssl.so" ("/system/lib/libssl.so") needed or dlopened by "/data/app/org.qtproject.example.bitcoinworld_wallet_admin-1/lib/arm/libQt5Core.so" is not accessible for the namespace "classloader-namespace" - the access is temporarily granted as a workaround for http://b/26394120, note that the access will be removed in future releases of Android.
    W bitcoinworld-wallet-admin: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve CRYPTO_free
    W bitcoinworld-wallet-admin: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve EVP_CipherFinal
    W bitcoinworld-wallet-admin: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_ctrl
    W bitcoinworld-wallet-admin: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve SSL_ctrl
    W bitcoinworld-wallet-admin: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
    W bitcoinworld-wallet-admin: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
    W bitcoinworld-wallet-admin: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve EC_get_builtin_curves
    W bitcoinworld-wallet-admin: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve EC_curve_nist2nid
    W bitcoinworld-wallet-admin: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot call unresolved function OPENSSL_add_all_algorithms_conf
    F libc    : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x4 in tid 28125 (QtThread)
    

    类似帖子:

    qnetworkrequest-not-working-on-qt-5-8-and-android-7-0

    @jcy



  • 一些参考资料 opensslsupport



  • QWebSocket for Android闪退问题

    在windows上编译openssl供Android NDK使用

    注意,网络上提供的 so 文件请仔细辨别,必要时,请自行编译!

    编译好的 libcrypto.solibssl.so 下载:QWebSocket-for-Android-openssl库

    @jcy @MidoriYakumo



  • @qyvlik 不清楚,因为我现在只有Android 4.4.4的设备,还没有Android 7.0的设备哦。这种手机太新了。





  • @qyvlik 谢谢分享哦,我吓得赶紧来膜拜一下,看看究竟是怎么回事。


 

最近的回复

  • 这个混合效果很赞!

    阅读更多
  • @里奇 快到碗里来~

    阅读更多
  • @青山白云 这个效果真的不错,还带半透明的特效。

    阅读更多
  • Opengl 和 Qml 混合编程 Opengl 描绘3D效果 Qml描绘2D效果 效果

    0_1527065966207_20180523_165855.gif

    源代码

    Fork me on Gitee

    加强版效果 1.底层的opengl描绘背景 2.在qml描绘前描绘opengl,所以opengl处于底层 3.中间层描绘qml 4.在qml描绘后描绘opengl,所以opengl处于顶层 5.使用QQuickItem构建组件,供qml调用,组件内部描绘opengl 6.为了让上层opengl背景透明

    观察可以发现每层的遮挡效果

    0_1527139142863_20180524_131344.gif

    1.底层的opengl描绘背景

    原理是在最远的地方放一张图片,放大图片,直到完全铺满视口

    //混合显示背景 glBlendFunc(GL_ONE, GL_ZERO); //描绘背景 glBindVertexArray(m_VAO[1]); glBindBuffer(GL_ARRAY_BUFFER, m_VBO[1]); glVertexAttribPointer(m_posAttr, 3, GL_FLOAT, GL_FALSE, sizeof(VertexData), (GLvoid*)0); glVertexAttribPointer(m_colAttr, 3, GL_FLOAT, GL_FALSE, sizeof(VertexData), (GLvoid*)(sizeof(QVector3D)*1)); glVertexAttribPointer(m_texcoordLocation, 2, GL_FLOAT, GL_FALSE, sizeof(VertexData), (GLvoid*)(sizeof(QVector3D)*2)); //背景的矩阵 QMatrix4x4 modelBg; modelBg.translate(0.0f, 0.0f, -10.0f); modelBg.scale(4.0f * 8, 3.0f * 8, 1.0f); modelBg.rotate(0, 0, 1, 0); m_program->setUniformValue(m_model, modelBg); m_textureBg->bind(); glDrawArrays(GL_QUADS,0, 4); m_textureBg->release(); 2.在qml描绘前描绘opengl,所以opengl处于底层

    以前我们是用timer来更新绘制,现在我们根据qml绘制时机,在渲染前,先渲染opengl,且不清除画面,然后再绘制qml,这样就变成上下两层,

    connect(window(), &QQuickWindow::beforeRendering, m_triangleWindow, &TriangleWindow::renderNow, Qt::DirectConnection); //渲染qml前不清画面,保留opengl win->setClearBeforeRendering(false); 4.在qml描绘后描绘opengl,所以opengl处于顶层

    渲染qml后,再次渲染opengl

    connect(window(), &QQuickWindow::afterRendering, m_triangleWindow, &UpTriangleWindow::renderNow, Qt::DirectConnection); mainwindow类继承QQuickItem,里面使用渲染qml前绘制opengl upmainwindow类继承QQuickItem,里面使用渲染qml后绘制opengl mainwindow类使用TriangleWindow这个opengl类,TriangleWindow里面绘制了背景图片 upmainwindow类使用UpTriangleWindow这个opengl类,里面为了透明背景,没有清除GL_COLOR_BUFFER_BIT颜色缓冲区 关于清除opengl背景问题,我使用混合,成功去除了清除色,但是背景仍然显示一个黑色,实在没有办法,于是使用了这个馊主意——没有清除GL_COLOR_BUFFER_BIT 注册

    将c++类注册到qml使用

    //注册opengl到qml qmlRegisterType<MainWindow>("MainWindow", 1, 0, "MainWindow"); qmlRegisterType<UpMainWindow>("UpMainWindow", 1, 0, "UpMainWindow"); 调用

    0_1527140533208_08cee63c-6392-4ad8-8ffe-d4e71ee6fdb1-image.png

    阅读更多

关注我们

微博
QQ群











召唤蕾姆