"make create-apk" does not find libraries

Alexander Neundorf neundorf at kde.org
Mon Mar 7 11:32:39 GMT 2022


Hi,

I'm trying to understand how the build process works for Android, so I try to 
do it manually.
Now when creating an apk it produces error messages that it cannot find 
libm.so, libc.so and libdl.so:

Generating flickable with /opt/Qt/bin/androiddeployqt
-- could not find libm.so in /home/user/docker_dev/Android/qtexamples/
embedded/flickable/build-android2 /usr/local/lib/ /opt/android-ndk/toolchains/
llvm/prebuilt/linux-x86_64/sysroot/
-- could not find libc++_shared.so in /home/user/docker_dev/Android/
qtexamples/embedded/flickable/build-android2 /usr/local/lib/ /opt/android-ndk/
toolchains/llvm/prebuilt/linux-x86_64/sysroot/
-- could not find libdl.so in /home/user/docker_dev/Android/qtexamples/
embedded/flickable/build-android2 /usr/local/lib/ /opt/android-ndk/toolchains/
llvm/prebuilt/linux-x86_64/sysroot/
-- could not find libc.so in /home/user/docker_dev/Android/qtexamples/
embedded/flickable/build-android2 /usr/local/lib/ /opt/android-ndk/toolchains/
llvm/prebuilt/linux-x86_64/sysroot/

This comes from the call to find_file() in specifydependencies.cmake:
    find_file(ourlib-${currentLib} ${currentLib} HINTS ${OUTPUT_DIR} $
{EXPORT_DIR} ${ECM_ADDITIONAL_FIND_ROOT_PATH} NO_DEFAULT_PATH PATH_SUFFIXES 
lib)

The libraries exist in /opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/
sysroot/usr/lib/arm-linux-androideabi/${VERSION}/

The  ANDROID_TOOLCHAIN_ROOT variable is set to "/opt/android-ndk/toolchains/
llvm/prebuilt/linux-x86_64", CMAKE_LIBRARY_ARCHITECTURE is set to 
"arm-linux-androideabi", and ANDROID_API_LEVEL is set to "21".
So in general cmake should know everything to find the libraries.
With CMAKE_FIND_ROOT_PATH set to /opt/android-ndk/toolchains/llvm/prebuilt/
linux-x86_64/sysroot/, find_library() should find the libraries, except that I 
don't know whether it also supports the ANDROID_API_LEVEL subdir (doesn't look 
like it).

So, is there a reason why the path for libm.so etc. seems not to be built up 
automatically from the various variables which are set automatically ?
I could work a bit on it...

Bye
Alex





More information about the KDE-Android mailing list