-
Notifications
You must be signed in to change notification settings - Fork 2
Error when compiling on github workflows #3
Description
hi, i got an error when forked your library and compile it using github workflows
here is the error:
https://github.com/Akmal4163/ValhallaAndroidPOC/actions/runs/11121905988/job/30902033996
i edited your script to build it, and adapt it to directory on my github workflows:
`export ANDROID_SDK=$HOME/Android
export NDK_DIR=$ANDROID_SDK/ndk/23.1.7779620 # <-- Update with the correct NDK path
Android toolchain
export TOOLCHAIN_FILE=$NDK_DIR/build/cmake/android.toolchain.cmake
TODO: Handle the abi and target as based on arguments
android_abis=("arm64-v8a" "armeabi-v7a" "x86" "x86_64")
android_targets=("aarch64-linux-android" "armv7a-linux-androideabi" "i686-linux-android" "x86_64-linux-android")
export ABI=arm64-v8a # TODO: Revert this to $1
export TARGET=aarch64-linux-android
export ANDROID_PLATFORM=android-28
export PROTOBUF_LOCAL_DIR=pwd/protoc
export BUILD_DIR=pwd/build/$ABI/wrapper
export WRAPPER_DIR=pwd/src
mkdir -p $BUILD_DIR && cd $BUILD_DIR
cmake
-DCMAKE_BUILD_TYPE=Release
-DENABLE_TOOLS=OFF -DENABLE_DATA_TOOLS=OFF
-DENABLE_PYTHON_BINDINGS=OFF -DENABLE_NODE_BINDINGS=OFF -DENABLE_HTTP=OFF -DENABLE_SERVICES=OFF
-DENABLE_TESTS=OFF -DENABLE_BENCHMARKS=OFF
-DENABLE_STATIC_LIBRARY_MODULES=ON
-DProtobuf_PROTOC_EXECUTABLE=$PROTOBUF_LOCAL_DIR/bin/protoc
-DANDROID_ABI=$ABI
-DANDROID_PLATFORM=$ANDROID_PLATFORM
-DANDROID_NDK=$NDK_DIR
-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE
-S $WRAPPER_DIR
-B .
make -j$(nproc)`
here is my github workflows :
`name: Build Valhalla for Android
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin' # Specify the distribution
- name: Install Android SDK and NDK
run: |
# Install required packages
sudo apt-get update
sudo apt-get install -y wget unzip
# Download command line tools
SDK_TOOLS_VERSION=8512546
wget https://dl.google.com/android/repository/commandlinetools-linux-${SDK_TOOLS_VERSION}_latest.zip
mkdir -p $HOME/Android/cmdline-tools
unzip commandlinetools-linux-${SDK_TOOLS_VERSION}_latest.zip -d $HOME/Android/cmdline-tools
rm commandlinetools-linux-${SDK_TOOLS_VERSION}_latest.zip
# Move the tools into the correct location
mv $HOME/Android/cmdline-tools/cmdline-tools $HOME/Android/cmdline-tools/latest
# Set up environment variables
echo "ANDROID_SDK=$HOME/Android" >> $GITHUB_ENV
echo "ANDROID_HOME=$ANDROID_SDK" >> $GITHUB_ENV
echo "NDK_VERSION=23.1.7779620" >> $GITHUB_ENV
# Install SDK and NDK using sdkmanager
yes | $HOME/Android/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK "platform-tools" "platforms;android-33" "ndk;25.2.9519653"
- name: Set up environment variables
run: |
echo "NDK=$ANDROID_SDK/ndk/25.2.9519653" >> $GITHUB_ENV
echo "VALHALLA_DIR=$GITHUB_WORKSPACE/extProjects/valhalla" >> $GITHUB_ENV
echo "TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64" >> $GITHUB_ENV
# Add Clang to PATH
echo "PATH=\$PATH:$TOOLCHAIN/bin" >> $GITHUB_ENV
- name: Install required packages
run: |
sudo apt-get install -y cmake build-essential wget
- name: Build Protobuf and Libvalhalla
run: |
git submodule update --init --recursive
# Build
./build_protoc_local.sh
./build_wrapper.sh
# Move the wrapper library to the right location for JNI
cp build/arm64-v8a/wrapper/wrapper/libvalhalla_wrapper.so valhalla/src/main/jniLibs/arm64-v8a`
is there any way to fix this?