Skip to content

Fix Android compilation errors #2

Fix Android compilation errors

Fix Android compilation errors #2

Workflow file for this run

name: Build for Android
on:
push:
branches:
- test
pull_request:
branches:
- test
jobs:
build:
runs-on: ubuntu-latest
env:
ANDROID_NDK_VERSION: "25" # 指定 Android NDK 版本
ANDROID_NDK_HOME: ${{ runner.temp }}/android-ndk

Check failure on line 17 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / Build for Android

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 17, Col: 25): Unrecognized named-value: 'runner'. Located at position 1 within expression: runner.temp .github/workflows/build.yml (Line: 40, Col: 14): Unrecognized named-value: 'ANDROID_NDK_HOME'. Located at position 1 within expression: ANDROID_NDK_HOME
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 8
- name: Download and set up Android NDK
run: |
wget https://dl.google.com/android/repository/android-ndk-${{ env.ANDROID_NDK_VERSION }}-linux-x86_64.zip -O android-ndk.zip
mkdir -p $ANDROID_NDK_HOME
unzip android-ndk.zip -d $ANDROID_NDK_HOME
env:
ANDROID_NDK_HOME: ${{ runner.temp }}/android-ndk
- name: Install Rust toolchain for aarch64-linux-android
run: rustup target add aarch64-linux-android
- name: Build with Cargo
run: |
export NDK_HOME=${{ ANDROID_NDK_HOME }}/android-ndk-${{ env.ANDROID_NDK_VERSION }}
cargo build --target aarch64-linux-android --release