Building Qt 6.9.1 for Android with ssl support.
-
I have built Qt 6.9.1 for Android without ssl support but I cannot build it with ssl support.
I have built openssl 3.5.0 for Android and installed it in /opt/qt-android
I have chosen this directory to try and keep everything for my Android build in one place.
I have a configuration script to setup my build:#! /bin/sh
rm -r build-qt
mkdir build-qtexport PKG_CONFIG_PATH=/opt/qt-android/lib/pkgconfig
export OPENSSL_ROOT_DIR=/opt/qt-android
export LD_LIBRARY_PATH=/opt/qt-android/libcd build-qt
../configure -platform android-clang -prefix /opt/qt-android -android-ndk /opt/android/sdk/ndk/29.0.13599879 -android-sdk /opt/android/sdk/ -qt-host-path /opt/qt6/ -android-abis arm64-v8a -skip qtwebengine -DANDROID_NATIVE_API_LEVEL=31 -openssl-linkedexit $?
with the -openssl-linked option set I get the folowing error
CMake Error at qtbase/cmake/QtBuildInformation.cmake:554 (message):
Feature "openssl_linked": Forcing to "ON" breaks its condition:TEST_opensslv11 OR TEST_opensslv30
Condition values dump:
TEST_opensslv11 = "FALSE" TEST_opensslv30 = "FALSE"
Call Stack (most recent call first):
qtbase/cmake/QtFeature.cmake:380 (qt_configure_add_report_error)
qtbase/cmake/QtFeature.cmake:500 (qt_feature_check_and_save_internal_value)
qtbase/cmake/QtFeature.cmake:769 (qt_evaluate_feature)
qtbase/cmake/QtBaseGlobalTargets.cmake:109 (qt_feature_module_end)
qtbase/cmake/QtBaseHelpers.cmake:186 (include)
qtbase/CMakeLists.txt:36 (qt_internal_qtbase_build_repo)Can anyone suggest what needs to be done to get this build working.
Thanks.@SMF-Qt said in Building Qt 6.9.1 for Android with ssl support.:
TEST_opensslv11 OR TEST_opensslv30
Looks like OpenSSL version 3.5 is not supported by that Qt version.
-
@jsulm building and compiling OpenSSL is failing for me too with Qt 6.9.0 and 6.9.1, tried OpenSSL 3.5 and 3.0 with LLVM on Windows 10 64bit. It works with MinGW...
I use conan package manager. -
@jsulm Similar but not exactly the same:
ERROR: Feature "openssl_linked": Forcing to "ON" breaks its condition:
TEST_opensslv11 OR TEST_opensslv30
Condition values dump:
TEST_opensslv11 = "FALSE"
TEST_opensslv30 = "FALSE"CMake Error at qtbase/cmake/QtBuildInformation.cmake:240 (message):
Check the configuration messages for an error that has occurred.
Call Stack (most recent call first):
qtbase/cmake/QtBuildInformation.cmake:59 (qt_configure_print_summary)
qtbase/cmake/QtBaseTopLevelHelpers.cmake:97 (qt_print_feature_summary)
qtbase/cmake/QtBaseTopLevelHelpers.cmake:76 (qt_internal_print_top_level_info)
CMakeLists.txt:124 (qt_internal_top_level_end)-- Configuring incomplete, errors occurred!
CMake Error at /work/Qt-Android/qt-everywhere-src-6.9.1/qtbase/cmake/QtProcessConfigureArgs.cmake:1143 (message):
CMake exited with code 1.CMake Error at /work/Qt-Android/qt-everywhere-src-6.9.1/cmake/QtIRProcessHelpers.cmake:173 (message):
/work/Qt-Android/qt-everywhere-src-6.9.1/qtbase/configure -top-level
-platform android-clang -prefix /opt/qt-android -android-ndk
/opt/android/sdk/ndk/29.0.13599879 -android-sdk /opt/android/sdk/
-qt-host-path /opt/qt6/ -android-abis arm64-v8a -skip qtwebengine
-DANDROID_NATIVE_API_LEVEL=31 -openssl-linked exited with status: 1Call Stack (most recent call first):
/work/Qt-Android/qt-everywhere-src-6.9.1/cmake/QtTopLevelHelpers.cmake:35 (qt_ir_execute_process_and_log_and_handle_error)
/work/Qt-Android/qt-everywhere-src-6.9.1/cmake/QtTopLevelHelpers.cmake:57 (qt_tl_run_toplevel_configure)
/work/Qt-Android/qt-everywhere-src-6.9.1/cmake/QtTopLevelConfigureScript.cmake:16 (qt_tl_run_main_script) -
@jsulm Similar but not exactly the same:
ERROR: Feature "openssl_linked": Forcing to "ON" breaks its condition:
TEST_opensslv11 OR TEST_opensslv30
Condition values dump:
TEST_opensslv11 = "FALSE"
TEST_opensslv30 = "FALSE"CMake Error at qtbase/cmake/QtBuildInformation.cmake:240 (message):
Check the configuration messages for an error that has occurred.
Call Stack (most recent call first):
qtbase/cmake/QtBuildInformation.cmake:59 (qt_configure_print_summary)
qtbase/cmake/QtBaseTopLevelHelpers.cmake:97 (qt_print_feature_summary)
qtbase/cmake/QtBaseTopLevelHelpers.cmake:76 (qt_internal_print_top_level_info)
CMakeLists.txt:124 (qt_internal_top_level_end)-- Configuring incomplete, errors occurred!
CMake Error at /work/Qt-Android/qt-everywhere-src-6.9.1/qtbase/cmake/QtProcessConfigureArgs.cmake:1143 (message):
CMake exited with code 1.CMake Error at /work/Qt-Android/qt-everywhere-src-6.9.1/cmake/QtIRProcessHelpers.cmake:173 (message):
/work/Qt-Android/qt-everywhere-src-6.9.1/qtbase/configure -top-level
-platform android-clang -prefix /opt/qt-android -android-ndk
/opt/android/sdk/ndk/29.0.13599879 -android-sdk /opt/android/sdk/
-qt-host-path /opt/qt6/ -android-abis arm64-v8a -skip qtwebengine
-DANDROID_NATIVE_API_LEVEL=31 -openssl-linked exited with status: 1Call Stack (most recent call first):
/work/Qt-Android/qt-everywhere-src-6.9.1/cmake/QtTopLevelHelpers.cmake:35 (qt_ir_execute_process_and_log_and_handle_error)
/work/Qt-Android/qt-everywhere-src-6.9.1/cmake/QtTopLevelHelpers.cmake:57 (qt_tl_run_toplevel_configure)
/work/Qt-Android/qt-everywhere-src-6.9.1/cmake/QtTopLevelConfigureScript.cmake:16 (qt_tl_run_main_script) -
@jsulm building and compiling OpenSSL is failing for me too with Qt 6.9.0 and 6.9.1, tried OpenSSL 3.5 and 3.0 with LLVM on Windows 10 64bit. It works with MinGW...
I use conan package manager.My system is Beyond Linux From Scratch StystemD R12.3-71. I have built it specifically for Android development so I can add anything that can be built from source to solve any particular problem. I do have Android studio and QtCreator installed but I have yet to try them. I prefer to build stuff by hand whenever possible.
-
@SMF-Qt said in Building Qt 6.9.1 for Android with ssl support.:
configuration tests get logged anywhere
Yes. In config.log or pass -v parameter to configure to get more verbose output.
-
@SMF-Qt said in Building Qt 6.9.1 for Android with ssl support.:
configuration tests get logged anywhere
Yes. In config.log or pass -v parameter to configure to get more verbose output.
@jsulm Thanks for the help it gave me ideas and I now have a solution of sorts:
I move /usr/bin/cmake to /usr/bin/cmake.bin
and created a script /usr/bin/cmake (+x):
#! /bin/sh
strace cmake.bin $@
exit $?I then ran the configure and created a Log file (1.7G!!!)
This gave me the details of what cmake was up to and I discovered that for me the important file searches are all relative to:
/opt/android/sdk/ndk/29.0.13599879/toolchains/llvm/prebuilt/linux-x86_64/sysroot
so I created a link:
lrwxrwxrwx 1 root root 5 Jun 26 15:02 /opt/android/sdk/ndk/29.0.13599879/toolchains/llvm/prebuilt/linux-x86_64/sysroot/opt -> /opt/
and for good measure added:
lrwxrwxrwx 1 root root 3 Jun 26 15:03 /opt/qt-android/lib64 -> lib
with these links in place and cmake put back to how it was the configure completed and so has the build.
My test application now builds and no longer complains about missing Qt SSL functions.
Not an ideal solution but I can live with it for now.
-
S SMF-Qt referenced this topic