ros2-java / ros2_java

Java and Android bindings for ROS2
Apache License 2.0
173 stars 93 forks source link

Fail! Building tracetools abort for missing libc++_shared.so #211

Open aitazhixin opened 2 years ago

aitazhixin commented 2 years ago

I have set ANDROID_NDK and ANDROID_HOME, ABI is arm64-v8a, ANDROID API is android-28.

aitazhixin commented 2 years ago

INPUT:

!/bin/bash

declare -a ANDROID_ABI_LIST=("arm64-v8a" "x86" "x86_64") export PYTHON3_EXEC="$( which python3 )" export PYTHON3_LIBRARY="$( ${PYTHON3_EXEC} -c 'import os.path; from distutils import sysconfig; print(os.path.realpath(os.path.join(sysconfig.get_config_var("LIBPL"), sysconfig.get_config_var("LDLIBRARY"))))' )" export PYTHON3_INCLUDE_DIR="$( ${PYTHON3_EXEC} -c 'from distutils import sysconfig; print(sysconfig.get_config_var("INCLUDEPY"))' )" export ANDROID_NDK=/nvroot/Android/Sdk/ndk/20.0.5594570 export ANDROID_HOME=/nvroot/Android/Sdk export ANDROID_NATIVE_API_LEVEL=android-21 export ANDROID_STL=c++_shared

ANDROID_ABI="arm64-v8a"

export ANDROID_TOOLCHAIN_NAME=llvm

colcon build \ --packages-ignore cyclonedds rcl_logging_log4cxx rosidl_generator_py \ --packages-up-to rcljava \ --cmake-args \ -DPYTHON_EXECUTABLE=${PYTHON3_EXEC} \ -DPYTHON_LIBRARY=${PYTHON3_LIBRARY} \ -DPYTHON_INCLUDE_DIR=${PYTHON3_INCLUDE_DIR} \ -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \ -DANDROID_FUNCTION_LEVEL_LINKING=OFF \ -DANDROID_NATIVE_API_LEVEL=${ANDROID_NATIVE_API_LEVEL} \ -DANDROID_TOOLCHAIN_NAME=${ANDROID_TOOLCHAIN_NAME} \ -DANDROID_STL=${ANDROID_STL} \ -DANDROID_ABI=${ANDROID_ABI} \ -DANDROID_NDK=${ANDROID_NDK} \ -DTHIRDPARTY=ON \ -DCOMPILE_EXAMPLES=OFF \ -DCMAKE_FIND_ROOT_PATH="${PWD}/install"

OUTPUT: --- stderr: tracetools
/nvroot/Android/Sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld: warning: libc++_shared.so, needed by libtracetools.so, not found (try using -rpath or -rpath-link) clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [CMakeFiles/status.dir/build.make:86: status] Error 1 make[1]: [CMakeFiles/Makefile2:136: CMakeFiles/status.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... make: [Makefile:141: all] Error 2

Failed <<< tracetools [1.17s, exited with code 2] Aborted <<< launch_testing [0.85s]