简体   繁体   English

Delphi Android 应用程序:无法加载 SSL 库

[英]Delphi Android app: Could not load SSL Library

I am developing an Android 32-bit app in Delphi.我正在 Delphi 中开发一个 Android 32 位应用程序。 I need to use OpenSSL libraries in my app in order to connect to an MQTT broker.我需要在我的应用程序中使用 OpenSSL 库才能连接到 MQTT 代理。

I am using OpenSSL 1.0.2t armeabi-v7a libcrypto.a and libssl.a static libraries.我正在使用 OpenSSL 1.0.2t armeabi-v7a libcrypto.alibssl.a static 库。 Through Delphi's Deployment Manager, I deploy them into my project's library\lib\armeabi-v7a folder for both Debug and Release configurations, but I keep getting a "Could not load SSL Library" error when I try to connect to the broker testing the app.通过 Delphi 的部署管理器,我将它们部署到我的项目的library\lib\armeabi-v7a文件夹中以进行调试和发布配置,但是当我尝试连接到测试应用程序的代理时,我不断收到“无法加载 SSL 库”错误.

I also tried deploying the armeabi version of libcrypto.a and libssl.a into library\lib\armeabi but I'm still getting the same error.我还尝试将libcrypto.alibssl.a的 armeabi 版本部署到library\lib\armeabi ,但我仍然遇到同样的错误。

After compiling the project, I checked that the libraries were succesfully deployed in the project folders (which they were).编译项目后,我检查了库是否已成功部署在项目文件夹中(它们是)。 The target device Android version is Android 11. Is the problem with the library version?目标设备Android版本是Android 11.是库版本的问题吗? Or am I missing another configuration step in Delphi?还是我错过了 Delphi 中的另一个配置步骤?

I've tried using OpenSSL 1.0.2o and 1.0.2n versions of the static libraries, but still no luck.我试过使用 OpenSSL 1.0.2o 和 1.0.2n 版本的 static 库,但仍然没有运气。

The error you are seeing is from Indy.您看到的错误来自 Indy。 The deployment is likely putting the lib files in a place that Indy can't find by default, or doesn't have access to.部署可能会将 lib 文件放在 Indy 默认找不到或无法访问的位置。 You may need to tell the deployment to put the files somewhere more accessible, and then tell Indy at runtime where the lib files are located after they have been deployed.您可能需要告诉部署将文件放在更易于访问的位置,然后在运行时告诉 Indy 部署后的 lib 文件所在的位置。 You can use the IdOpenSSLSetLibPath() function in the IdSSLOpenSSLHeaders unit for that purpose.为此,您可以在IdSSLOpenSSLHeaders单元中使用IdOpenSSLSetLibPath() function。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM