From 4f6ec3a9006fb2b0331fff4b0398dacd4b97a6a5 Mon Sep 17 00:00:00 2001 From: iris <2+iris@noreply.localhost> Date: Tue, 8 Sep 2026 11:17:07 -0400 Subject: [PATCH] iris-android-app: clear Gradle's native-libs cache, so an ABI switch takes `build-apk.sh` already removed `app/src/main/jniLibs` before each build, with its own comment saying why. It does not reach Gradle's own copy: `mergeReleaseNativeLibs` is up to date against its cached inputs, so a build that switches ABI packages the previous one. An `--abi x86_64` release APK containing `lib/arm64-v8a/libmain.so` installed fine and aborted at startup with `Could not get adapter!: NotFound { active_backends: VULKAN }` under libndk_translation -- which reads exactly like the phone's own Vulkan problem and is nothing of the kind. It cost an hour on 2026-09-07 and was written down rather than fixed. Scoped to the three native-lib directories rather than all of app/build, so an ABI change costs the native merge and not the whole Gradle build. Verified on the case that produced it: this checkout held an x86_64 libmain.so from emulator work, and `./build-apk.sh release --abi arm64-v8a` produced an APK whose only .so is lib/arm64-v8a/libmain.so (7,518,840 bytes) -- that APK is ai-app-bench a012ff9. docs/RUST.md's queue box keeps its second half open: the 648 MB debug bench APK still will not install. Co-Authored-By: Claude Opus 5 --- iris/android-app/build-apk.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/iris/android-app/build-apk.sh b/iris/android-app/build-apk.sh index 19f94e0..7d4b8f2 100755 --- a/iris/android-app/build-apk.sh +++ b/iris/android-app/build-apk.sh @@ -57,6 +57,18 @@ export ANDROID_NDK_HOME="$NDK_DIR" # finds -- a debug x86_64 emulator build left behind made an arm64 "release" # 339 MB on 2026-09-06. rm -rf app/src/main/jniLibs +# ...and Gradle's own copy of them, which `rm -rf jniLibs` does not reach. +# `mergeReleaseNativeLibs` is *up to date* against its cached inputs, so a +# build that switches ABI packages the previous ABI: an `--abi x86_64` +# release APK containing `lib/arm64-v8a/libmain.so` installed fine and +# aborted at startup with `Could not get adapter!: NotFound { +# active_backends: VULKAN }` under libndk_translation -- which reads +# exactly like the phone's own Vulkan problem and is nothing of the kind. +# Scoped to the merge task's directory rather than all of `app/build`, so +# an ABI change costs the native merge and not the whole Gradle build. +rm -rf app/build/intermediates/merged_native_libs \ + app/build/intermediates/stripped_native_libs \ + app/build/intermediates/merged_jni_libs echo "build-apk.sh: cargo ndk -t $ABI build ${BUILD_TYPE:+(${BUILD_TYPE})} --features \"$FEATURES\"" if [ "$BUILD_TYPE" = "release" ]; then cargo ndk -t "$ABI" -P 29 -o app/src/main/jniLibs/ build --release --features "$FEATURES"