Skip to content

Commit 87f18ba

Browse files
committed
ci: fix in android environment
1 parent be79ae5 commit 87f18ba

File tree

1 file changed

+6
-39
lines changed

1 file changed

+6
-39
lines changed

.github/workflows/CI.yml

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -221,47 +221,14 @@ jobs:
221221
sudo apt-get update
222222
sudo apt-get install -y build-essential libssl-dev pkg-config
223223
224-
- name: Setup Android NDK Environment
224+
- name: Install Android NDK
225225
if: ${{ contains(matrix.settings.target, 'android') }}
226226
run: |
227-
# Find Android SDK installation
228-
ANDROID_SDK=""
229-
if [ -d "/usr/lib/android-sdk" ]; then
230-
ANDROID_SDK="/usr/lib/android-sdk"
231-
elif [ -d "/opt/android-sdk" ]; then
232-
ANDROID_SDK="/opt/android-sdk"
233-
elif [ -d "$HOME/android-sdk" ]; then
234-
ANDROID_SDK="$HOME/android-sdk"
235-
elif [ -d "/usr/local/android-sdk" ]; then
236-
ANDROID_SDK="/usr/local/android-sdk"
237-
else
238-
echo "Android SDK not found, trying to find NDK directly..."
239-
# Try to find NDK directly
240-
NDK_PATH=$(find /usr /opt /home -name "ndk*" -type d 2>/dev/null | head -1)
241-
if [ -n "$NDK_PATH" ]; then
242-
ANDROID_SDK=$(dirname "$NDK_PATH")
243-
fi
244-
fi
245-
246-
if [ -z "$ANDROID_SDK" ]; then
247-
echo "Error: Android SDK not found. Please install android-sdk package."
248-
exit 1
249-
fi
250-
251-
echo "Found Android SDK at: $ANDROID_SDK"
252-
# Find NDK in the SDK
253-
NDK_ROOT=$(find "$ANDROID_SDK" -name "ndk*" -type d | head -1)
254-
if [ -z "$NDK_ROOT" ]; then
255-
echo "NDK not found in SDK, trying alternative locations..."
256-
NDK_ROOT=$(find /usr /opt -name "ndk*" -type d 2>/dev/null | head -1)
257-
fi
258-
259-
if [ -z "$NDK_ROOT" ] || [ ! -d "$NDK_ROOT" ]; then
260-
echo "Error: NDK not found. Please ensure NDK is installed with the SDK."
261-
exit 1
262-
fi
263-
264-
echo "Using NDK at: $NDK_ROOT"
227+
echo "Installing Android NDK..."
228+
# Download and install Android NDK
229+
wget https://dl.google.com/android/repository/android-ndk-r25c-linux.zip
230+
unzip android-ndk-r25c-linux.zip
231+
NDK_ROOT="$PWD/android-ndk-r25c"
265232
echo "ANDROID_NDK_ROOT=$NDK_ROOT" >> $GITHUB_ENV
266233
echo "$NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_PATH
267234

0 commit comments

Comments
 (0)