From e1a9f2ed6db83803757794aa4967486781c9dcae Mon Sep 17 00:00:00 2001 From: Scott McKay Date: Wed, 6 Sep 2023 10:12:05 +1000 Subject: [PATCH] Fix insufficient space error in Android CI (#17423) ### Description Remove onnxruntime_test_all from emulator once tests have finished as it's 1.2GB and takes up too much space given the 2GB maximum partition size for the emulator. Side issue is the java build isn't able to strip the binaries in the java apk which causes that to be 800MB (exceeding the 2GB max). That may require an Android/Gradle fix as I don't think we can hardcode an NDK version into our build files. https://issuetracker.google.com/issues/237187538?pli=1 ### Motivation and Context Fix Android CI build failures for --- tools/ci_build/build.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 65f17dd138..48129e1593 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1673,6 +1673,10 @@ def run_android_tests(args, source_dir, build_dir, config, cwd): adb_shell(f"chmod +x {device_dir}/onnx_test_runner") run_adb_shell(f"{device_dir}/onnxruntime_test_all") + # remove onnxruntime_test_all as it takes up a _lot_ of space and can cause insufficient storage errors + # when we try to copy the java app to the device. + adb_shell(f"rm {device_dir}/onnxruntime_test_all") + if args.build_java: # use the gradle wrapper under /java gradle_executable = os.path.join(source_dir, "java", "gradlew.bat" if is_windows() else "gradlew")