I am attempting to build the android tunnel app. I have setup android studio however I am getting a few build issues. Firstly I had to update gradle.properties to set the cmake.version to 3.30.3 because 3.30.1 is not downloadable via android studio.
Then after building I got an error for llhttp. I was able to get some progress by adding llhttp the the tunnel/CMakeLists.txt
include(FetchContent)
FetchContent_Declare(
llhttp
URL "https://github.com/nodejs/llhttp/archive/refs/tags/v9.3.0.tar.gz"
)
FetchContent_MakeAvailable(llhttp)
however I am still getting an error when running the gradle sync within Android Studio.
Error Log
> Task :prepareKotlinBuildScriptModel UP-TO-DATE
C/C++: dependencies built in /home/user/dev/tools/ziti-tunnel-android/tunnel/build/cmake
C/C++: building for x86
C/C++: deps_abi_path = /home/user/dev/tools/ziti-tunnel-android/tunnel/build/cmake/x86-android/vcpkg_installed/x86-android
C/C++: tunnel only = OFF
C/C++: exclude programs = ON
C/C++: Found Git executable "/usr/bin/git".
C/C++: Parsed GIT_VERSION: "v1.6.0-0-g23823a8", PROJECT_SEMVER: "1.6.0".
C/C++: project version: v1.6.0 (git version v1.6.0)
C/C++: cross-compiling: TRUE
C/C++: project version: 1.6.5
C/C++: git info:
C/C++: branch : HEAD
C/C++: hash : gd72ea7c
C/C++: using Ninja
C/C++: cross-compiling TRUE
C/C++: Project: tlsuv@v0.35.0
C/C++: CMake Error at /home/user/dev/tools/ziti-tunnel-android/tunnel/.cxx/Debug/2u3k2w4f/x86/_deps/tlsuv-src/CMakeLists.txt:153 (find_package):
C/C++: Could not find a package configuration file provided by "llhttp" with any
C/C++: of the following names:
C/C++: llhttpConfig.cmake
C/C++: llhttp-config.cmake
C/C++: Add the installation prefix of "llhttp" to CMAKE_PREFIX_PATH or set
C/C++: "llhttp_DIR" to a directory containing one of the above files. If "llhttp"
C/C++: provides a separate development package or SDK, be sure it has been
C/C++: installed.
[CXX1429] error when building with cmake using /home/user/dev/tools/ziti-tunnel-android/tunnel/src/main/cpp/CMakeLists.txt: -- The C compiler identification is Clang 18.0.1
-- The CXX compiler identification is Clang 18.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/user/Android/Sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/linux-x86_64/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/user/Android/Sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.43.0")
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1")
-- Checking for module 'libuv'
-- Found libuv, version 1.48.0
-- Found ZLIB: /home/user/Android/Sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/i686-linux-android/26/libz.so (found suitable version "1.3.0.1", minimum required is "1")
-- Configuring incomplete, errors occurred!
C++ build system [configure] failed while executing:
/home/user/Android/Sdk/cmake/3.30.3/bin/cmake \
-H/home/user/dev/tools/ziti-tunnel-android/tunnel/src/main/cpp \
-DCMAKE_SYSTEM_NAME=Android \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_SYSTEM_VERSION=26 \
-DANDROID_PLATFORM=android-26 \
-DANDROID_ABI=x86 \
-DCMAKE_ANDROID_ARCH_ABI=x86 \
-DANDROID_NDK=/home/user/Android/Sdk/ndk/27.0.12077973 \
-DCMAKE_ANDROID_NDK=/home/user/Android/Sdk/ndk/27.0.12077973 \
-DCMAKE_TOOLCHAIN_FILE=/home/user/Android/Sdk/ndk/27.0.12077973/build/cmake/android.toolchain.cmake \
-DCMAKE_MAKE_PROGRAM=/home/user/Android/Sdk/cmake/3.30.3/bin/ninja \
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/user/dev/tools/ziti-tunnel-android/tunnel/build/intermediates/cxx/Debug/2u3k2w4f/obj/x86 \
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/home/user/dev/tools/ziti-tunnel-android/tunnel/build/intermediates/cxx/Debug/2u3k2w4f/obj/x86 \
-DCMAKE_BUILD_TYPE=Debug \
-B/home/user/dev/tools/ziti-tunnel-android/tunnel/.cxx/Debug/2u3k2w4f/x86 \
-GNinja \
-DDEPS_DIR=/home/user/dev/tools/ziti-tunnel-android/tunnel/build/cmake \
-Dtunnel_sdk_VERSION=v1.6.0
from /home/user/dev/tools/ziti-tunnel-android/tunnel
dependencies built in /home/user/dev/tools/ziti-tunnel-android/tunnel/build/cmake
building for x86
deps_abi_path = /home/user/dev/tools/ziti-tunnel-android/tunnel/build/cmake/x86-android/vcpkg_installed/x86-android
tunnel only = OFF
exclude programs = ON
Found Git executable "/usr/bin/git".
Parsed GIT_VERSION: "v1.6.0-0-g23823a8", PROJECT_SEMVER: "1.6.0".
project version: v1.6.0 (git version v1.6.0)
cross-compiling: TRUE
project version: 1.6.5
git info:
branch : HEAD
hash : gd72ea7c
using Ninja
cross-compiling TRUE
Project: tlsuv@v0.35.0
CMake Error at /home/user/dev/tools/ziti-tunnel-android/tunnel/.cxx/Debug/2u3k2w4f/x86/_deps/tlsuv-src/CMakeLists.txt:153 (find_package):
Could not find a package configuration file provided by "llhttp" with any
of the following names:
llhttpConfig.cmake
llhttp-config.cmake
Add the installation prefix of "llhttp" to CMAKE_PREFIX_PATH or set
"llhttp_DIR" to a directory containing one of the above files. If "llhttp"
provides a separate development package or SDK, be sure it has been
installed. : com.android.ide.common.process.ProcessException: -- The C compiler identification is Clang 18.0.1
I did see another thread relating to llhttp but I couldn't see how that user solved the issue.