From 68fc02026081ba61888e0f78e5f7ad540681ac27 Mon Sep 17 00:00:00 2001 From: TheM14 Date: Sat, 31 Oct 2026 02:55:20 +0800 Subject: [PATCH] Replace the dangling jniLibs link before copying the libraries mpv-android ships app/src/main/jniLibs as a symlink for the ABI its own build wants, so mkdir -p fails with "File exists" when the link target does not exist. Replace the link (or file) with a plain directory and copy the three libraries into arm64-v8a/. --- .github/workflows/build-android.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 900a488..fbbc189 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -166,7 +166,18 @@ jobs: run: | set -euo pipefail abi=arm64-v8a - libs="$GITHUB_WORKSPACE/android/app/src/main/jniLibs/$abi" + jni="$GITHUB_WORKSPACE/android/app/src/main/jniLibs" + # The checkout carries this path as a symlink (pointing at a prefix + # directory for an ABI we do not build), and mkdir -p refuses a + # dangling link with "File exists". Replace it with a plain directory. + if [ -L "$jni" ]; then + echo "jniLibs is a symlink to $(readlink "$jni" 2>/dev/null || echo '?'); replacing it" + rm -f "$jni" + elif [ -e "$jni" ] && [ ! -d "$jni" ]; then + echo "jniLibs is a file; replacing it with a directory" + rm -f "$jni" + fi + libs="$jni/$abi" mkdir -p "$libs" cp "$GITHUB_WORKSPACE/android/buildscripts/prefix/arm64/lib/libmpv.so" "$libs/" cp "$GITHUB_WORKSPACE/joc/build-android/libjoc_core.so" "$libs/"