From 76c55b22d8eeb0e17cc47a0cbefa4ea1f91319a0 Mon Sep 17 00:00:00 2001 From: Mergen Nachin Date: Fri, 16 Jan 2026 09:56:17 -0500 Subject: [PATCH] Fix Android emulator CI test file permission error Use internal cache directory instead of external cache directory for Android instrumentation tests. On Android API 34, scoped storage restrictions prevent writing to external storage even for app-specific directories. Internal storage (cacheDir) requires no permissions and works reliably on all API levels. - Change externalCacheDir to cacheDir in TestFileUtils - Remove unnecessary READ_EXTERNAL_STORAGE permission from manifest - Remove GrantPermissionRule from all test files --- .../executorch_android/src/androidTest/AndroidManifest.xml | 1 - .../org/pytorch/executorch/LlmModuleInstrumentationTest.kt | 7 ------- .../java/org/pytorch/executorch/ModuleE2ETest.kt | 6 ------ .../org/pytorch/executorch/ModuleInstrumentationTest.kt | 7 ------- .../java/org/pytorch/executorch/TestFileUtils.kt | 3 +-- .../pytorch/executorch/training/TrainingModuleE2ETest.kt | 6 ------ 6 files changed, 1 insertion(+), 29 deletions(-) diff --git a/extension/android/executorch_android/src/androidTest/AndroidManifest.xml b/extension/android/executorch_android/src/androidTest/AndroidManifest.xml index 7ea0516e5c2..cb2a2dcdc53 100644 --- a/extension/android/executorch_android/src/androidTest/AndroidManifest.xml +++ b/extension/android/executorch_android/src/androidTest/AndroidManifest.xml @@ -1,6 +1,5 @@ -