Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] Cross-compiling ONNX for Android on Windows CMAKE Ninja error #21242

Closed
AkulRT opened this issue Jul 3, 2024 · 9 comments · Fixed by #21304
Closed

[Build] Cross-compiling ONNX for Android on Windows CMAKE Ninja error #21242

AkulRT opened this issue Jul 3, 2024 · 9 comments · Fixed by #21304
Labels
api:Java issues related to the Java API build build issues; typically submitted using template platform:mobile issues related to ONNX Runtime mobile; typically submitted using template platform:windows issues related to the Windows platform

Comments

@AkulRT
Copy link

AkulRT commented Jul 3, 2024

Describe the issue

I am trying to cross-compile ONNX for Android on Windows. I have been unable to use the "Install on Android" method in Android Studio because I get a "Exception in thread "main" java.lang.UnsatisfiedLinkError: no onnxruntime4j_jni in java.library.path" when I try to run a test function that simply creates an ORTEnvironment, ORTSession and then prints the session metadata. I have the onnxruntime repo cloned, I've made an "Android" directory within that, and I have my target Sdk platform and ndk=27.0.11902837

Urgency

No response

Target platform

Android

Build script

./build.bat --android --android_sdk_path \Android --android_ndk_path \Android\ndk\27.0.11902837 --android_abi arm64-v8a --android_api 29 --cmake_generator Ninja --build_java --bundle_shared_lib

Error / output

build [DEBUG] - Command line arguments:
--build_dir 'C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\build\Windows' --android --android_sdk_path '\Android' --android_ndk_path '\Android\ndk\27.0.11902837' --android_abi arm64-v8a --android_api 29 --cmake_generator Ninja --build_java --build_shared_lib
Namespace(build_dir='C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\\build\Windows', config=['Debug'], update=False, build=False, clean=False, parallel=1, nvcc_threads=-1, test=False, skip_tests=False, compile_no_warning_as_error=False, enable_nvtx_profile=False, enable_memory_profile=False, enable_training=False, enable_training_apis=False, enable_training_ops=False, enable_nccl=False, mpi_home=None, nccl_home=None, use_mpi=False, enable_onnx_tests=False, path_to_protoc_exe=None, fuzz_testing=False, enable_symbolic_shape_infer_tests=False, gen_doc=None, gen_api_doc=False, use_cuda=False, cuda_version=None, cuda_home=None, cudnn_home=None, enable_cuda_line_info=False, enable_cuda_nhwc_ops=False, enable_pybind=False, build_wheel=False, wheel_name_suffix=None, numpy_version=None, skip_keras_test=False, build_csharp=False, build_nuget=False, msbuild_extra_options=None, build_java=True, build_nodejs=False, build_objc=False, build_shared_lib=True, build_apple_framework=False, cmake_extra_defines=None, target=None, x86=False, rv64=False, arm=False, arm64=False, arm64ec=False, buildasx=False, riscv_toolchain_root='', riscv_qemu_path='', msvc_toolset=None, windows_sdk_version=None, android=True, android_abi='arm64-v8a', android_api=29, android_sdk_path='\Android', android_ndk_path='\Android\ndk\27.0.11902837', android_cpp_shared=False, android_run_emulator=False, use_gdk=False, gdk_edition='.', gdk_platform='Scarlett', ios=False, visionos=False, macos=None, apple_sysroot='', ios_toolchain_file='', visionos_toolchain_file='', xcode_code_signing_team_id='', xcode_code_signing_identity='', cmake_generator='Ninja', osx_arch='x86_64', apple_deploy_target=None, enable_address_sanitizer=False, use_binskim_compliant_compile_flags=False, disable_memleak_checker=False, build_wasm=False, build_wasm_static_lib=False, emsdk_version='3.1.59', enable_wasm_simd=False, enable_wasm_threads=False, disable_wasm_exception_catching=False, enable_wasm_api_exception_catching=False, enable_wasm_exception_throwing_override=True, wasm_run_tests_in_browser=False, enable_wasm_profiling=False, enable_wasm_debug_info=False, wasm_malloc=None, emscripten_settings=None, use_extensions=False, extensions_overridden_path=None, cmake_path='cmake', ctest_path='ctest', skip_submodule_sync=False, use_mimalloc=False, use_dnnl=False, dnnl_gpu_runtime='', dnnl_opencl_root='', use_openvino=None, dnnl_aarch64_runtime='', dnnl_acl_root='', use_coreml=False, use_webnn=False, use_snpe=False, snpe_root=None, use_nnapi=False, use_vsinpu=False, nnapi_min_api=None, use_jsep=False, use_qnn=False, qnn_home=None, use_rknpu=False, use_preinstalled_eigen=False, eigen_path=None, enable_msinternal=False, llvm_path=None, use_vitisai=False, use_tvm=False, tvm_cuda_runtime=False, use_tvm_hash=False, use_tensorrt=False, use_tensorrt_builtin_parser=True, use_tensorrt_oss_parser=False, tensorrt_home=None, test_all_timeout='10800', use_migraphx=False, migraphx_home=None, use_full_protobuf=False, llvm_config='', skip_onnx_tests=False, skip_winml_tests=False, skip_nodejs_tests=False, enable_msvc_static_runtime=False, use_dml=False, dml_path='', use_winml=False, winml_root_namespace_override=None, dml_external_project=False, use_telemetry=False, enable_wcos=False, enable_lto=False, enable_transformers_tool_test=False, use_acl=None, acl_home=None, acl_libs=None, use_armnn=False, armnn_relu=False, armnn_bn=False, armnn_home=None, armnn_libs=None, build_micro_benchmarks=False, minimal_build=None, include_ops_by_config=None, enable_reduced_operator_type_support=False, disable_contrib_ops=False, disable_ml_ops=False, disable_rtti=False, disable_types=[], disable_exceptions=False, rocm_version=None, use_rocm=False, rocm_home=None, code_coverage=False, enable_lazy_tensor=False, ms_experimental=False, enable_external_custom_op_schemas=False, external_graph_transformer_path=None, enable_cuda_profiling=False, use_cann=False, cann_home=None, enable_rocm_profiling=False, use_xnnpack=False, use_azure=False, use_cache=False, use_triton_kernel=False, use_lock_free_queue=False)
2024-07-03 14:18:38,625 build [DEBUG] - Defaulting to running update, build [and test for native builds].
2024-07-03 14:18:38,633 build [INFO] - Build started
2024-07-03 14:18:38,633 build [INFO] - git submodule sync --recursive
Synchronizing submodule url for 'cmake/external/emsdk'
Synchronizing submodule url for 'cmake/external/libprotobuf-mutator'
Synchronizing submodule url for 'cmake/external/onnx'
Synchronizing submodule url for 'cmake/external/onnx/third_party/benchmark'
Synchronizing submodule url for 'cmake/external/onnx/third_party/pybind11'
2024-07-03 14:18:39,104 build [INFO] - git submodule update --init --recursive
2024-07-03 14:18:39,556 build [INFO] - Generating CMake build tree
2024-07-03 14:18:39,557 build [INFO] - C:\Program Files\CMake\bin\cmake.EXE C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\cmake -Donnxruntime_RUN_ONNX_TESTS=OFF -Donnxruntime_GENERATE_TEST_REPORTS=ON -DPython_EXECUTABLE=C:\Program Files\Python311\python.exe -DPYTHON_EXECUTABLE=C:\Program Files\Python311\python.exe -Donnxruntime_USE_MIMALLOC=OFF -Donnxruntime_ENABLE_PYTHON=OFF -Donnxruntime_BUILD_CSHARP=OFF -Donnxruntime_BUILD_JAVA=ON -Donnxruntime_BUILD_NODEJS=OFF -Donnxruntime_BUILD_OBJC=OFF -Donnxruntime_BUILD_SHARED_LIB=ON -Donnxruntime_BUILD_APPLE_FRAMEWORK=OFF -Donnxruntime_USE_DNNL=OFF -Donnxruntime_USE_NNAPI_BUILTIN=OFF -Donnxruntime_USE_VSINPU=OFF -Donnxruntime_USE_RKNPU=OFF -Donnxruntime_USE_LLVM=OFF -Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF -Donnxruntime_USE_VITISAI=OFF -Donnxruntime_USE_TENSORRT=OFF -Donnxruntime_USE_TENSORRT_BUILTIN_PARSER=ON -Donnxruntime_USE_TVM=OFF -Donnxruntime_TVM_CUDA_RUNTIME=OFF -Donnxruntime_TVM_USE_HASH=OFF -Donnxruntime_USE_MIGRAPHX=OFF -Donnxruntime_DISABLE_CONTRIB_OPS=OFF -Donnxruntime_DISABLE_ML_OPS=OFF -Donnxruntime_DISABLE_RTTI=OFF -Donnxruntime_DISABLE_EXCEPTIONS=OFF -Donnxruntime_MINIMAL_BUILD=OFF -Donnxruntime_EXTENDED_MINIMAL_BUILD=OFF -Donnxruntime_MINIMAL_BUILD_CUSTOM_OPS=OFF -Donnxruntime_REDUCED_OPS_BUILD=OFF -Donnxruntime_USE_DML=OFF -Donnxruntime_USE_WINML=OFF -Donnxruntime_BUILD_MS_EXPERIMENTAL_OPS=OFF -Donnxruntime_USE_TELEMETRY=OFF -Donnxruntime_ENABLE_LTO=OFF -Donnxruntime_USE_ACL=OFF -Donnxruntime_USE_ACL_1902=OFF -Donnxruntime_USE_ACL_1905=OFF -Donnxruntime_USE_ACL_1908=OFF -Donnxruntime_USE_ACL_2002=OFF -Donnxruntime_USE_ACL_2308=OFF -Donnxruntime_USE_ARMNN=OFF -Donnxruntime_ARMNN_RELU_USE_CPU=ON -Donnxruntime_ARMNN_BN_USE_CPU=ON -Donnxruntime_USE_JSEP=OFF -Donnxruntime_ENABLE_NVTX_PROFILE=OFF -Donnxruntime_ENABLE_TRAINING=OFF -Donnxruntime_ENABLE_TRAINING_OPS=OFF -Donnxruntime_ENABLE_TRAINING_APIS=OFF -Donnxruntime_ENABLE_CPU_FP16_OPS=OFF -Donnxruntime_USE_NCCL=OFF -Donnxruntime_BUILD_BENCHMARKS=OFF -Donnxruntime_USE_ROCM=OFF -Donnxruntime_GCOV_COVERAGE=OFF -Donnxruntime_USE_MPI=OFF -Donnxruntime_ENABLE_MEMORY_PROFILE=OFF -Donnxruntime_ENABLE_CUDA_LINE_NUMBER_INFO=OFF -Donnxruntime_USE_CUDA_NHWC_OPS=OFF -Donnxruntime_BUILD_WEBASSEMBLY_STATIC_LIB=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_CATCHING=ON -Donnxruntime_ENABLE_WEBASSEMBLY_API_EXCEPTION_CATCHING=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_THROWING=ON -Donnxruntime_WEBASSEMBLY_RUN_TESTS_IN_BROWSER=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_THREADS=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_DEBUG_INFO=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_PROFILING=OFF -Donnxruntime_ENABLE_LAZY_TENSOR=OFF -Donnxruntime_ENABLE_EXTERNAL_CUSTOM_OP_SCHEMAS=OFF -Donnxruntime_ENABLE_CUDA_PROFILING=OFF -Donnxruntime_ENABLE_ROCM_PROFILING=OFF -Donnxruntime_USE_XNNPACK=OFF -Donnxruntime_USE_WEBNN=OFF -Donnxruntime_USE_CANN=OFF -Donnxruntime_USE_TRITON_KERNEL=OFF -Donnxruntime_DISABLE_FLOAT8_TYPES=ON -Donnxruntime_DISABLE_SPARSE_TENSORS=OFF -Donnxruntime_DISABLE_OPTIONAL_TYPE=OFF -DCMAKE_TOOLCHAIN_FILE=\Android\ndk\27.0.11902837\build\cmake\android.toolchain.cmake -DANDROID_PLATFORM=android-29 -DANDROID_ABI=arm64-v8a -DANDROID_MIN_SDK=29 -DCMAKE_VS_GLOBALS=UseMultiToolTask=true;EnforceProcessCountAcrossBuilds=true -DCMAKE_TLS_VERIFY=ON -DFETCHCONTENT_QUIET=OFF -DONNX_USE_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dgtest_force_shared_crt=ON -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=ProgramDatabase -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\build\Windows\Debug\installed
CMake Deprecation Warning at CMakeLists.txt:14 (cmake_policy):
The OLD behavior for policy CMP0104 will be removed from a future version
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.

CMake Error at C:/Program Files/CMake/share/cmake-3.30/Modules/CMakeDetermineSystem.cmake:152 (message):
Could not find toolchain file:
\Android\ndk\27.0.11902837\build\cmake\android.toolchain.cmake
Call Stack (most recent call first):
CMakeLists.txt:20 (project)

CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_ASM_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\tools\ci_build\build.py", line 2972, in
sys.exit(main())
^^^^^^
File "C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\tools\ci_build\build.py", line 2829, in main
generate_build_tree(
File "C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\tools\ci_build\build.py", line 1677, in generate_build_tree
run_subprocess(
File "C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\tools\ci_build\build.py", line 862, in run_subprocess
return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\tools\python\util\run.py", line 49, in run
completed_process = subprocess.run(
^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\Program Files\CMake\bin\cmake.EXE', 'C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\cmake', '-Donnxruntime_RUN_ONNX_TESTS=OFF', '-Donnxruntime_GENERATE_TEST_REPORTS=ON', '-DPython_EXECUTABLE=C:\Program Files\Python311\python.exe', '-DPYTHON_EXECUTABLE=C:\Program Files\Python311\python.exe', '-Donnxruntime_USE_MIMALLOC=OFF', '-Donnxruntime_ENABLE_PYTHON=OFF', '-Donnxruntime_BUILD_CSHARP=OFF', '-Donnxruntime_BUILD_JAVA=ON', '-Donnxruntime_BUILD_NODEJS=OFF', '-Donnxruntime_BUILD_OBJC=OFF', '-Donnxruntime_BUILD_SHARED_LIB=ON', '-Donnxruntime_BUILD_APPLE_FRAMEWORK=OFF', '-Donnxruntime_USE_DNNL=OFF', '-Donnxruntime_USE_NNAPI_BUILTIN=OFF', '-Donnxruntime_USE_VSINPU=OFF', '-Donnxruntime_USE_RKNPU=OFF', '-Donnxruntime_USE_LLVM=OFF', '-Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF', '-Donnxruntime_USE_VITISAI=OFF', '-Donnxruntime_USE_TENSORRT=OFF', '-Donnxruntime_USE_TENSORRT_BUILTIN_PARSER=ON', '-Donnxruntime_USE_TVM=OFF', '-Donnxruntime_TVM_CUDA_RUNTIME=OFF', '-Donnxruntime_TVM_USE_HASH=OFF', '-Donnxruntime_USE_MIGRAPHX=OFF', '-Donnxruntime_DISABLE_CONTRIB_OPS=OFF', '-Donnxruntime_DISABLE_ML_OPS=OFF', '-Donnxruntime_DISABLE_RTTI=OFF', '-Donnxruntime_DISABLE_EXCEPTIONS=OFF', '-Donnxruntime_MINIMAL_BUILD=OFF', '-Donnxruntime_EXTENDED_MINIMAL_BUILD=OFF', '-Donnxruntime_MINIMAL_BUILD_CUSTOM_OPS=OFF', '-Donnxruntime_REDUCED_OPS_BUILD=OFF', '-Donnxruntime_USE_DML=OFF', '-Donnxruntime_USE_WINML=OFF', '-Donnxruntime_BUILD_MS_EXPERIMENTAL_OPS=OFF', '-Donnxruntime_USE_TELEMETRY=OFF', '-Donnxruntime_ENABLE_LTO=OFF', '-Donnxruntime_USE_ACL=OFF', '-Donnxruntime_USE_ACL_1902=OFF', '-Donnxruntime_USE_ACL_1905=OFF', '-Donnxruntime_USE_ACL_1908=OFF', '-Donnxruntime_USE_ACL_2002=OFF', '-Donnxruntime_USE_ACL_2308=OFF', '-Donnxruntime_USE_ARMNN=OFF', '-Donnxruntime_ARMNN_RELU_USE_CPU=ON', '-Donnxruntime_ARMNN_BN_USE_CPU=ON', '-Donnxruntime_USE_JSEP=OFF', '-Donnxruntime_ENABLE_NVTX_PROFILE=OFF', '-Donnxruntime_ENABLE_TRAINING=OFF', '-Donnxruntime_ENABLE_TRAINING_OPS=OFF', '-Donnxruntime_ENABLE_TRAINING_APIS=OFF', '-Donnxruntime_ENABLE_CPU_FP16_OPS=OFF', '-Donnxruntime_USE_NCCL=OFF', '-Donnxruntime_BUILD_BENCHMARKS=OFF', '-Donnxruntime_USE_ROCM=OFF', '-Donnxruntime_GCOV_COVERAGE=OFF', '-Donnxruntime_USE_MPI=OFF', '-Donnxruntime_ENABLE_MEMORY_PROFILE=OFF', '-Donnxruntime_ENABLE_CUDA_LINE_NUMBER_INFO=OFF', '-Donnxruntime_USE_CUDA_NHWC_OPS=OFF', '-Donnxruntime_BUILD_WEBASSEMBLY_STATIC_LIB=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_CATCHING=ON', '-Donnxruntime_ENABLE_WEBASSEMBLY_API_EXCEPTION_CATCHING=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_THROWING=ON', '-Donnxruntime_WEBASSEMBLY_RUN_TESTS_IN_BROWSER=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_THREADS=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_DEBUG_INFO=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_PROFILING=OFF', '-Donnxruntime_ENABLE_LAZY_TENSOR=OFF', '-Donnxruntime_ENABLE_EXTERNAL_CUSTOM_OP_SCHEMAS=OFF', '-Donnxruntime_ENABLE_CUDA_PROFILING=OFF', '-Donnxruntime_ENABLE_ROCM_PROFILING=OFF', '-Donnxruntime_USE_XNNPACK=OFF', '-Donnxruntime_USE_WEBNN=OFF', '-Donnxruntime_USE_CANN=OFF', '-Donnxruntime_USE_TRITON_KERNEL=OFF', '-Donnxruntime_DISABLE_FLOAT8_TYPES=ON', '-Donnxruntime_DISABLE_SPARSE_TENSORS=OFF', '-Donnxruntime_DISABLE_OPTIONAL_TYPE=OFF', '-DCMAKE_TOOLCHAIN_FILE=\Android\ndk\27.0.11902837\build\cmake\android.toolchain.cmake', '-DANDROID_PLATFORM=android-29', '-DANDROID_ABI=arm64-v8a', '-DANDROID_MIN_SDK=29', '-DCMAKE_VS_GLOBALS=UseMultiToolTask=true;EnforceProcessCountAcrossBuilds=true', '-DCMAKE_TLS_VERIFY=ON', '-DFETCHCONTENT_QUIET=OFF', '-DONNX_USE_MSVC_STATIC_RUNTIME=OFF', '-Dprotobuf_MSVC_STATIC_RUNTIME=OFF', '-Dgtest_force_shared_crt=ON', '-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=ProgramDatabase', '-G', 'Ninja', '-DCMAKE_BUILD_TYPE=Debug', '-DCMAKE_PREFIX_PATH=C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\\build\Windows\Debug\installed']' returned non-zero exit status 1.

Visual Studio Version

No response

GCC / Compiler Version

No response

@AkulRT AkulRT added the build build issues; typically submitted using template label Jul 3, 2024
@github-actions github-actions bot added api:Java issues related to the Java API platform:mobile issues related to ONNX Runtime mobile; typically submitted using template platform:windows issues related to the Windows platform labels Jul 3, 2024
@edgchen1
Copy link
Contributor

edgchen1 commented Jul 3, 2024

CMake Error at C:/Program Files/CMake/share/cmake-3.30/Modules/CMakeDetermineSystem.cmake:152 (message):
Could not find toolchain file:
\Android\ndk\27.0.11902837\build\cmake\android.toolchain.cmake
Call Stack (most recent call first):
CMakeLists.txt:20 (project)

It's not finding the toolchain file. Verify that it exists.

CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.

Install Ninja and make sure it is in PATH.

@AkulRT
Copy link
Author

AkulRT commented Jul 4, 2024

@edgchen1

Hi. I've checked the cmake directory in \Android and it does exist. I also do have Ninja installed and it is in my path.

@edgchen1
Copy link
Contributor

edgchen1 commented Jul 5, 2024

It seems like CMake can't find the toolchain file. Could you try passing an absolute path with the drive letter?

E.g., assuming the Android SDK directory is at C:\Android:
--android_sdk_path C:\Android --android_ndk_path C:\Android\ndk\27.0.11902837

@AkulRT
Copy link
Author

AkulRT commented Jul 8, 2024

@edgchen1, thank you! I can't believe I didn't think of it, but that worked!

@AkulRT AkulRT closed this as completed Jul 8, 2024
@AkulRT AkulRT reopened this Jul 8, 2024
@AkulRT
Copy link
Author

AkulRT commented Jul 8, 2024

Sorry, I was too hasty in closing the issue. Build was successful until the very last line:

[1270/1271] Linking C shared module libonnxruntime4j_jni.so
FAILED: libonnxruntime4j_jni.so
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\ndk\27.0.11902837\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=aarch64-none-linux-android29 --sysroot=C:/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/Android/ndk/27.0.11902837/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -ffunction-sections -fdata-sections -fno-limit-debug-info -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--no-undefined-version -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -shared -o libonnxruntime4j_jni.so CMakeFiles/onnxruntime4j_jni.dir/C_/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/java/src/main/native/OrtJniUtil.c.o CMakeFiles/onnxruntime4j_jni.dir/C_/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/java/src/main/native/ai_onnxruntime_OnnxMap.c.o CMakeFiles/onnxruntime4j_jni.dir/C_/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/java/src/main/native/ai_onnxruntime_OnnxRuntime.c.o CMakeFiles/onnxruntime4j_jni.dir/C_/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/java/src/main/native/ai_onnxruntime_OnnxSequence.c.o CMakeFiles/onnxruntime4j_jni.dir/C_/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/java/src/main/native/ai_onnxruntime_OnnxSparseTensor.c.o CMakeFiles/onnxruntime4j_jni.dir/C_/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/java/src/main/native/ai_onnxruntime_OnnxTensor.c.o CMakeFiles/onnxruntime4j_jni.dir/C_/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/java/src/main/native/ai_onnxruntime_OrtAllocator.c.o CMakeFiles/onnxruntime4j_jni.dir/C_/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/java/src/main/native/ai_onnxruntime_OrtEnvironment.c.o CMakeFiles/onnxruntime4j_jni.dir/368b657d31d5c8d946e3ffa48aa52ef0/Internship/onnxruntime/java/src/main/native/ai_onnxruntime_OrtEnvironment_ThreadingOptions.c.o CMakeFiles/onnxruntime4j_jni.dir/C_/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/java/src/main/native/ai_onnxruntime_OrtSession.c.o CMakeFiles/onnxruntime4j_jni.dir/C_/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/java/src/main/native/ai_onnxruntime_OrtSession_RunOptions.c.o CMakeFiles/onnxruntime4j_jni.dir/C_/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/java/src/main/native/ai_onnxruntime_OrtSession_SessionOptions.c.o CMakeFiles/onnxruntime4j_jni.dir/C_/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/java/src/main/native/ai_onnxruntime_OrtTrainingSession.c.o CMakeFiles/onnxruntime4j_jni.dir/c53a0c4b77e6a66f6f0aee84536e34ec/onnxruntime/java/src/main/native/ai_onnxruntime_OrtTrainingSession_OrtCheckpointState.c.o CMakeFiles/onnxruntime4j_jni.dir/368b657d31d5c8d946e3ffa48aa52ef0/Internship/onnxruntime/java/src/main/native/ai_onnxruntime_providers_OrtCUDAProviderOptions.c.o CMakeFiles/onnxruntime4j_jni.dir/c53a0c4b77e6a66f6f0aee84536e34ec/onnxruntime/java/src/main/native/ai_onnxruntime_providers_OrtTensorRTProviderOptions.c.o libonnxruntime.so -latomic -lm && C:\WINDOWS\system32\cmd.exe /C "cd /D C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\build\Windows\Debug && "C:\Program Files\CMake\bin\cmake.exe" -E copy_if_different C:/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/build/Windows/Debug/libonnxruntime.so C:/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/build/Windows/Debug/java/native-lib/ai/onnxruntime/native/android-arm64-v8a/libonnxruntime.so && cd /D C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\build\Windows\Debug && "C:\Program Files\CMake\bin\cmake.exe" -E copy_if_different C:/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/build/Windows/Debug/libonnxruntime4j_jni.so C:/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/build/Windows/Debug/java/native-jni/ai/onnxruntime/native/android-arm64-v8a/libonnxruntime4j_jni.so && cd /D C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\java && C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\java\gradlew --console=plain cmakeBuild -DcmakeBuildDir=C:/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/build/Windows/Debug --no-daemon && cd /D C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\build\Windows\Debug && "C:\Program Files\CMake\bin\cmake.exe" -E copy_if_different C:/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/build/Windows/Debug/libonnxruntime.so C:/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/build/Windows/Debug/java/android/arm64-v8a/libonnxruntime.so && cd /D C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\build\Windows\Debug && "C:\Program Files\CMake\bin\cmake.exe" -E copy_if_different C:/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/build/Windows/Debug/libonnxruntime4j_jni.so C:/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/build/Windows/Debug/java/android/arm64-v8a/libonnxruntime4j_jni.so && cd /D C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\java && "C:\Program Files\CMake\bin\cmake.exe" -E echo "Generating Android AAR package..." && C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\java\gradlew build -b build-android.gradle -c settings-android.gradle -DjniLibsDir=C:/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/build/Windows/Debug/java/android -DbuildDir=C:/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/build/Windows/Debug/java/build/android -DminSdkVer=29 -DheadersDir=C:/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/build/Windows/Debug/android/headers --stacktrace && cd /D C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\build\Windows\Debug && "C:\Program Files\CMake\bin\cmake.exe" -E copy_if_different C:/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/build/Windows/Debug/java/build/android/outputs/aar/onnxruntime-debug.aar C:/Users/akula/Desktop/Akul/School_Stuff/Internship/onnxruntime/build/Windows/Debug/java/androidtest/android/app/libs/onnxruntime-android.aar && cd /D C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\build\Windows\Debug\java\androidtest\android && "C:\Program Files\CMake\bin\cmake.exe" -E echo "Building and running Android test for Android AAR package..." && C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\java\gradlew clean assembleDebug assembleDebugAndroidTest -DminSdkVer=29 --stacktrace""
To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.6/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
Daemon will be stopped at the end of the build

Task :spotlessInternalRegisterDependencies UP-TO-DATE
Task :spotlessJava UP-TO-DATE
Task :compileJava UP-TO-DATE
Task :processResources NO-SOURCE
Task :classes UP-TO-DATE
Task :generatePomFileForMavenPublication
Task :allJar
Task :javadoc
Task :javadocJar
Task :sourcesJar
Task :cmakeBuild

BUILD SUCCESSFUL in 52s
9 actionable tasks: 6 executed, 3 up-to-date
Generating Android AAR package...
Starting a Gradle Daemon (subsequent builds will be faster)

Configure project :
Checking the license for package Android SDK Platform-Tools in C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\licenses
License for package Android SDK Platform-Tools accepted.
Preparing "Install Android SDK Platform-Tools (revision: 35.0.1)".
"Install Android SDK Platform-Tools (revision: 35.0.1)" ready.
Installing Android SDK Platform-Tools in C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\platform-tools
"Install Android SDK Platform-Tools (revision: 35.0.1)" complete.
"Install Android SDK Platform-Tools (revision: 35.0.1)" finished.
Checking the license for package Android Emulator in C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\licenses
License for package Android Emulator accepted.
Preparing "Install Android Emulator (revision: 34.2.15)".
"Install Android Emulator (revision: 34.2.15)" ready.
Installing Android Emulator in C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\emulator
"Install Android Emulator (revision: 34.2.15)" complete.
"Install Android Emulator (revision: 34.2.15)" finished.
Checking the license for package Android SDK Tools in C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\licenses
License for package Android SDK Tools accepted.
Preparing "Install Android SDK Tools (revision: 26.1.1)".
"Install Android SDK Tools (revision: 26.1.1)" ready.
Installing Android SDK Tools in C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\tools
"Install Android SDK Tools (revision: 26.1.1)" complete.
"Install Android SDK Tools (revision: 26.1.1)" finished.
Checking the license for package Android SDK Build-Tools 30.0.3 in C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\licenses
License for package Android SDK Build-Tools 30.0.3 accepted.
Preparing "Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)".
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" ready.
Installing Android SDK Build-Tools 30.0.3 in C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\build-tools\30.0.3
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" complete.
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" finished.
Checking the license for package Android SDK Platform 32 in C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\licenses
License for package Android SDK Platform 32 accepted.
Preparing "Install Android SDK Platform 32 (revision: 1)".
"Install Android SDK Platform 32 (revision: 1)" ready.
Installing Android SDK Platform 32 in C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\platforms\android-32
"Install Android SDK Platform 32 (revision: 1)" complete.
"Install Android SDK Platform 32 (revision: 1)" finished.
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the gradle.properties file or use the new publishing DSL.

Task :preBuild UP-TO-DATE
Task :preDebugBuild UP-TO-DATE
Task :compileDebugAidl NO-SOURCE
Task :mergeDebugJniLibFolders
Task :compileDebugRenderscript NO-SOURCE
Task :generateDebugBuildConfig
Task :generateDebugResValues
Task :generateDebugResources
Task :packageDebugResources
Task :extractDeepLinksForAarDebug
Task :javaPreCompileDebug
Task :mergeDebugShaders
Task :compileDebugShaders NO-SOURCE
Task :generateDebugAssets UP-TO-DATE
Task :packageDebugAssets
Task :packageDebugRenderscript NO-SOURCE
Task :parseDebugLocalResources
Task :prepareDebugArtProfile
Task :processDebugJavaRes NO-SOURCE
Task :prepareLintJarForPublish
Task :preReleaseBuild UP-TO-DATE
Task :compileReleaseAidl NO-SOURCE
Task :writeDebugAarMetadata
Task :mergeDebugJavaResource
Task :processDebugManifest
Task :mergeDebugNativeLibs
Task :mergeReleaseJniLibFolders
Task :compileReleaseRenderscript NO-SOURCE
Task :generateReleaseResValues
Task :extractDeepLinksForAarRelease
Task :generateReleaseBuildConfig
Task :generateReleaseResources
Task :packageReleaseResources
Task :generateDebugRFile
Task :parseReleaseLocalResources
Task :processReleaseManifest

Task :stripDebugDebugSymbols
Unable to strip the following libraries, packaging them as they are: libonnxruntime.so, libonnxruntime4j_jni.so.

Task :mergeReleaseNativeLibs
Task :extractDebugAnnotations
Task :compileDebugJavaWithJavac
Task :mergeDebugGeneratedProguardFiles
Task :mergeDebugConsumerProguardFiles
Task :syncDebugLibJars
Task :copyDebugJniLibsProjectAndLocalJars
Task :generateReleaseRFile

Task :stripReleaseDebugSymbols
Unable to strip the following libraries, packaging them as they are: libonnxruntime.so, libonnxruntime4j_jni.so.

Task :bundleDebugAar
Task :assembleDebug
Task :extractReleaseAnnotations
Task :javaPreCompileRelease
Task :mergeReleaseShaders
Task :compileReleaseJavaWithJavac
Task :mergeReleaseGeneratedProguardFiles
Task :mergeReleaseConsumerProguardFiles
Task :compileReleaseShaders NO-SOURCE
Task :generateReleaseAssets UP-TO-DATE
Task :packageReleaseAssets
Task :packageReleaseRenderscript NO-SOURCE
Task :prepareReleaseArtProfile
Task :processReleaseJavaRes NO-SOURCE
Task :writeReleaseAarMetadata
Task :mergeReleaseJavaResource
Task :mapReleaseSourceSetPaths
Task :syncReleaseLibJars
Task :copyReleaseJniLibsProjectAndLocalJars
Task :mergeReleaseResources
Task :bundleReleaseAar
Task :javadoc FAILED
Task :verifyReleaseResources

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':javadoc'.

Cannot access input property 'classpath' of task ':javadoc'. Accessing unreadable inputs or outputs is not supported. Declare the task as untracked by using Task.doNotTrackState(). For more information, please refer to https://docs.gradle.org/8.6/userguide/incremental_build.html#sec:disable-state-tracking in the Gradle documentation.
Could not stat file C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\platforms\android-32\android.jar;C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\build-tools\30.0.3\core-lambda-stubs.jar

  • Try:

Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':javadoc'.
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:38)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
    at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:331)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:318)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.lambda$execute$0(DefaultTaskExecutionGraph.java:314)
    at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:314)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
    Caused by: org.gradle.internal.deprecation.DocumentedFailure$DocumentedExceptionWithCause: Cannot access input property 'classpath' of task ':javadoc'. Accessing unreadable inputs or outputs is not supported. Declare the task as untracked by using Task.doNotTrackState(). For more information, please refer to https://docs.gradle.org/8.6/userguide/incremental_build.html#sec:disable-state-tracking in the Gradle documentation.
    at org.gradle.internal.deprecation.DocumentedFailure$Builder.build(DocumentedFailure.java:71)
    at org.gradle.api.internal.tasks.execution.TaskExecution.decorateSnapshottingException(TaskExecution.java:385)
    at org.gradle.api.internal.tasks.execution.TaskExecution.visitRegularInputs(TaskExecution.java:337)
    at org.gradle.internal.execution.impl.DefaultInputFingerprinter.fingerprintInputProperties(DefaultInputFingerprinter.java:63)
    at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.captureExecutionStateWithOutputs(AbstractCaptureStateBeforeExecutionStep.java:109)
    at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.lambda$captureExecutionState$0(AbstractCaptureStateBeforeExecutionStep.java:74)
    at org.gradle.internal.execution.steps.BuildOperationStep$1.call(BuildOperationStep.java:37)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
    at org.gradle.internal.execution.steps.BuildOperationStep.operation(BuildOperationStep.java:34)
    at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.captureExecutionState(AbstractCaptureStateBeforeExecutionStep.java:69)
    at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.execute(AbstractCaptureStateBeforeExecutionStep.java:62)
    at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.execute(AbstractCaptureStateBeforeExecutionStep.java:43)
    at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.executeWithNonEmptySources(AbstractSkipEmptyWorkStep.java:125)
    at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.execute(AbstractSkipEmptyWorkStep.java:61)
    at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.execute(AbstractSkipEmptyWorkStep.java:36)
    at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
    at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:36)
    at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:23)
    at org.gradle.internal.execution.steps.HandleStaleOutputsStep.execute(HandleStaleOutputsStep.java:75)
    at org.gradle.internal.execution.steps.HandleStaleOutputsStep.execute(HandleStaleOutputsStep.java:41)
    at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.lambda$execute$0(AssignMutableWorkspaceStep.java:35)
    at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:292)
    at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.execute(AssignMutableWorkspaceStep.java:31)
    at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.execute(AssignMutableWorkspaceStep.java:22)
    at org.gradle.internal.execution.steps.ChoosePipelineStep.execute(ChoosePipelineStep.java:40)
    at org.gradle.internal.execution.steps.ChoosePipelineStep.execute(ChoosePipelineStep.java:23)
    at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.lambda$execute$2(ExecuteWorkBuildOperationFiringStep.java:66)
    at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:66)
    at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:38)
    at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:36)
    at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:26)
    at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:47)
    at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:34)
    at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:61)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:145)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:134)
    at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
    at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:331)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:318)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.lambda$execute$0(DefaultTaskExecutionGraph.java:314)
    at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:314)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
    Caused by: org.gradle.api.UncheckedIOException: Could not stat file C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\platforms\android-32\android.jar;C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\build-tools\30.0.3\core-lambda-stubs.jar
    at org.gradle.internal.nativeintegration.filesystem.services.NativePlatformBackedFileMetadataAccessor.stat(NativePlatformBackedFileMetadataAccessor.java:43)
    at org.gradle.internal.nativeintegration.filesystem.services.GenericFileSystem.stat(GenericFileSystem.java:107)
    at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$snapshot$8(DefaultFileSystemAccess.java:168)
    at org.gradle.internal.vfs.impl.AbstractVirtualFileSystem.store(AbstractVirtualFileSystem.java:90)
    at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.snapshot(DefaultFileSystemAccess.java:166)
    at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$read$0(DefaultFileSystemAccess.java:92)
    at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$readSnapshotFromLocation$9(DefaultFileSystemAccess.java:199)
    at org.gradle.internal.vfs.impl.DefaultFileSystemAccess$StripedProducerGuard.guardByKey(DefaultFileSystemAccess.java:248)
    at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$readSnapshotFromLocation$10(DefaultFileSystemAccess.java:196)
    at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.readSnapshotFromLocation(DefaultFileSystemAccess.java:196)
    at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.read(DefaultFileSystemAccess.java:89)
    at org.gradle.internal.fingerprint.impl.DefaultFileCollectionSnapshotter$SnapshottingVisitor.visitCollection(DefaultFileCollectionSnapshotter.java:70)
    at org.gradle.api.internal.file.AbstractOpaqueFileCollection.visitContents(AbstractOpaqueFileCollection.java:60)
    at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:361)
    at org.gradle.api.internal.file.CompositeFileCollection.lambda$visitContents$0(CompositeFileCollection.java:113)
    at org.gradle.api.internal.file.collections.UnpackingVisitor.visitSingleFile(UnpackingVisitor.java:114)
    at org.gradle.api.internal.file.collections.UnpackingVisitor.add(UnpackingVisitor.java:109)
    at org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection$UnresolvedItemsCollector.visitContents(DefaultConfigurableFileCollection.java:425)
    at org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection.visitChildren(DefaultConfigurableFileCollection.java:300)
    at org.gradle.api.internal.file.CompositeFileCollection.visitContents(CompositeFileCollection.java:113)
    at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:361)
    at org.gradle.api.internal.file.CompositeFileCollection.lambda$visitContents$0(CompositeFileCollection.java:113)
    at org.gradle.api.internal.file.UnionFileCollection.visitChildren(UnionFileCollection.java:81)
    at org.gradle.api.internal.file.CompositeFileCollection.visitContents(CompositeFileCollection.java:113)
    at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:361)
    at org.gradle.api.internal.file.CompositeFileCollection.lambda$visitContents$0(CompositeFileCollection.java:113)
    at org.gradle.api.internal.file.collections.UnpackingVisitor.add(UnpackingVisitor.java:67)
    at org.gradle.api.internal.file.collections.UnpackingVisitor.add(UnpackingVisitor.java:92)
    at org.gradle.api.internal.file.DefaultFileCollectionFactory$ResolvingFileCollection.visitChildren(DefaultFileCollectionFactory.java:285)
    at org.gradle.api.internal.file.CompositeFileCollection.visitContents(CompositeFileCollection.java:113)
    at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:361)
    at org.gradle.api.internal.file.CompositeFileCollection.lambda$visitContents$0(CompositeFileCollection.java:113)
    at org.gradle.api.internal.tasks.PropertyFileCollection.visitChildren(PropertyFileCollection.java:48)
    at org.gradle.api.internal.file.CompositeFileCollection.visitContents(CompositeFileCollection.java:113)
    at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:361)
    at org.gradle.internal.fingerprint.impl.DefaultFileCollectionSnapshotter.snapshot(DefaultFileCollectionSnapshotter.java:47)
    at org.gradle.internal.execution.impl.DefaultInputFingerprinter$InputCollectingVisitor.visitInputFileProperty(DefaultInputFingerprinter.java:133)
    at org.gradle.api.internal.tasks.execution.TaskExecution.visitRegularInputs(TaskExecution.java:327)
    ... 68 more
    Caused by: net.rubygrapefruit.platform.NativeException: Could not get file details of C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\platforms\android-32\android.jar;C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\build-tools\30.0.3\core-lambda-stubs.jar: could not file attributes (errno 123)
    at net.rubygrapefruit.platform.internal.DefaultWindowsFiles.stat(DefaultWindowsFiles.java:38)
    at net.rubygrapefruit.platform.internal.DefaultWindowsFiles.stat(DefaultWindowsFiles.java:28)
    at org.gradle.internal.nativeintegration.filesystem.services.NativePlatformBackedFileMetadataAccessor.stat(NativePlatformBackedFileMetadataAccessor.java:41)
    ... 105 more

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.6/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 2m 43s
51 actionable tasks: 51 executed
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\tools\ci_build\build.py", line 2972, in
sys.exit(main())
^^^^^^
File "C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\tools\ci_build\build.py", line 2864, in main
build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target)
File "C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\tools\ci_build\build.py", line 1742, in build_targets
run_subprocess(cmd_args, env=env)
File "C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\tools\ci_build\build.py", line 862, in run_subprocess
return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\tools\python\util\run.py", line 49, in run
completed_process = subprocess.run(
^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\Program Files\CMake\bin\cmake.EXE', '--build', 'C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\\build\Windows\Debug', '--config', 'Debug']' returned non-zero exit status 1.

I checked the created build folder and for arm64-v8a, I have two .so files (libonnxruntime, libonnxruntime4j_jni). There are also a bunch of other folders with other .so files. My question is if the javadoc error is an ignorable kind of error? Can I copy the .so files and use them in Android Studio?

@edgchen1
Copy link
Contributor

edgchen1 commented Jul 8, 2024

My question is if the javadoc error is an ignorable kind of error?

It's not an expected error.

Could not stat file C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\platforms\android-32\android.jar;C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android\build-tools\30.0.3\core-lambda-stubs.jar

Do those files exist? Is your Android SDK directory at C:\Users\akula\Desktop\Akul\School_Stuff\Internship\onnxruntime\Android?

@snnn snnn added feature request request for unsupported feature or enhancement and removed feature request request for unsupported feature or enhancement labels Jul 8, 2024
@AkulRT
Copy link
Author

AkulRT commented Jul 9, 2024

Yup, that's my SDK directory, and the two files exist, I just checked the directories.

@edgchen1
Copy link
Contributor

I can reproduce the issue. I think #21304 should fix it. Was able to build successfully on Windows with that change.

@AkulRT
Copy link
Author

AkulRT commented Jul 10, 2024

Build was successful after making the gradle change.

Just an FYI, I also had to change lines 37 & 40 in android.py from onnxruntime/tools/python/util/android. I think the android.py file isn't in sync with the official Build for Android instructions because it expects the path to be sdk-root/cmdline-tools/latest/bin, but the instructions state the path needs to be sdk-root/cmdline-tools/tools/bin.

Thank you for all your help @edgchen1 !

@AkulRT AkulRT closed this as completed Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api:Java issues related to the Java API build build issues; typically submitted using template platform:mobile issues related to ONNX Runtime mobile; typically submitted using template platform:windows issues related to the Windows platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants