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] FAILED BUILD libonnxruntime4j_jni.so #22835

Closed
Lutan701 opened this issue Nov 14, 2024 · 2 comments
Closed

[Build] FAILED BUILD libonnxruntime4j_jni.so #22835

Lutan701 opened this issue Nov 14, 2024 · 2 comments
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

Comments

@Lutan701
Copy link

Describe the issue

HELP!!!

I want onnxruntime to run on Android 4.4.

When I was compiling the code, the following error occurred:

$ ./build.bat --android --android_sdk_path D:/Android/SDK --android_ndk_path D:/Android/SDK/ndk/28.0.12433566 --android_abi armeabi-v7a --android_api 19 --cmake_generator Ninja --build_java
2024-11-14 10:41:51,694 tools_python_utils [INFO] - flatbuffers module is not installed. parse_config will not be available
2024-11-14 10:41:51,697 build [DEBUG] - Command line arguments:
--build_dir 'E:\onnxruntime\onnxruntime\build\Windows' --android --android_sdk_path D:/Android/SDK --android_ndk_path D:/Android/SDK/ndk/28.0.12433566 --android_abi armeabi-v7a --android_api 19 --cmake_generator Ninja --build_java
2024-11-14 10:41:51,708 build [DEBUG] - Defaulting to running update, build [and test for native builds].
2024-11-14 10:41:51,715 build [INFO] - Build started
2024-11-14 10:41:51,715 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-11-14 10:41:52,300 build [INFO] - git submodule update --init --recursive
2024-11-14 10:41:52,875 build [INFO] - Generating CMake build tree
2024-11-14 10:41:52,875 build [INFO] - D:\cmake-3.28.0-windows-x86_64\bin\cmake.EXE E:\onnxruntime\onnxruntime\cmake -Donnxruntime_RUN_ONNX_TESTS=OFF -Donnxruntime_GENERATE_TEST_REPORTS=ON -DPython_EXECUTABLE=C:\Users\admin\AppData\Local\Programs\Python\Python311\python.exe -DPYTHON_EXECUTABLE=C:\Users\admin\AppData\Local\Programs\Python\Python311\python.exe -Donnxruntime_USE_VCPKG=OFF -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_ARMNN=OFF -Donnxruntime_ARMNN_RELU_USE_CPU=ON -Donnxruntime_ARMNN_BN_USE_CPU=ON -Donnxruntime_USE_JSEP=OFF -Donnxruntime_USE_WEBGPU=OFF -Donnxruntime_USE_EXTERNAL_DAWN=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_MEMORY64=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=D:\Android\SDK\ndk\28.0.12433566\build\cmake\android.toolchain.cmake -DANDROID_PLATFORM=android-19 -DANDROID_ABI=armeabi-v7a -DANDROID_MIN_SDK=19 -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 -DABSL_MSVC_STATIC_RUNTIME=OFF -Dgtest_force_shared_crt=ON -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=ProgramDatabase -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=E:\onnxruntime\onnxruntime\build\Windows/Debug/installed
CMake Deprecation Warning at CMakeLists.txt:15 (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.

-- android-19 is unsupported. Using minimum supported version 21.
CMake Warning (dev) at CMakeLists.txt:62 (include):
Policy CMP0145 is not set: The Dart and FindDart modules are removed. Run
"cmake --help-policy CMP0145" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at D:/cmake-3.28.0-windows-x86_64/share/cmake-3.28/Modules/Dart.cmake:47 (message):
Policy CMP0145 is not set: The Dart and FindDart modules are removed. Run
"cmake --help-policy CMP0145" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
CMakeLists.txt:62 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at D:/cmake-3.28.0-windows-x86_64/share/cmake-3.28/Modules/Dart.cmake:57 (find_package):
Policy CMP0144 is not set: find_package uses upper-case _ROOT
variables. Run "cmake --help-policy CMP0144" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.

CMake variable DART_ROOT is set to:

DART_ROOT-NOTFOUND

For compatibility, find_package is ignoring the variable, but code in a
.cmake module might still use it.
Call Stack (most recent call first):
CMakeLists.txt:62 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

F16C instruction set is not supported.
FMA instruction set is not supported.
AVX instruction set is not supported.
One or more AVX/F16C instruction flags are not supported.
Building ONNX Runtime for armv7-a CPU ARCH
Patch found: D:/Git/usr/bin/patch.exe
Doing crosscompiling
-- Loading Dependencies URLs ...
-- Loading Dependencies ...
-- Populating abseil_cpp
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/abseil_cpp-subbuild
ninja: no work to do.
-- Abseil source dir:E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/abseil_cpp-src
-- Populating re2
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/re2-subbuild
ninja: no work to do.
-- Populating googletest
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/googletest-subbuild
ninja: no work to do.
-- Populating utf8_range
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/utf8_range-subbuild
ninja: no work to do.
-- CMAKE_HOST_SYSTEM_NAME: Windows
-- Populating protoc_binary
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/protoc_binary-subbuild
ninja: no work to do.
-- Use prebuilt protoc
-- Populating protobuf
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/protobuf-subbuild
ninja: no work to do.

-- 3.21.12.0
-- Populating date
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/date-subbuild
ninja: no work to do.
-- Populating mp11
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/mp11-subbuild
ninja: no work to do.
-- Populating nlohmann_json
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/nlohmann_json-subbuild
ninja: no work to do.
CMake Deprecation Warning at E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/nlohmann_json-src/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

-- Using the single-header code from E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/nlohmann_json-src/single_include/
-- Populating pytorch_cpuinfo
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/pytorch_cpuinfo-subbuild
ninja: no work to do.
-- Populating gsl
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/gsl-subbuild
ninja: no work to do.
-- Populating safeint
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/safeint-subbuild
ninja: no work to do.
-- Populating flatbuffers
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/flatbuffers-subbuild
ninja: no work to do.
-- Proceeding with version: 23.5.26.0
-- CMAKE_CXX_FLAGS: -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -ffunction-sections -fdata-sections -DCPUINFO_SUPPORTED
-- Populating onnx
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/onnx-subbuild
ninja: no work to do.
CMake Warning (dev) at E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/onnx-src/CMakeLists.txt:107 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers. Use -Wno-dev to suppress it.

-- Using custom protoc executable
Generated: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/onnx-build/onnx/onnx-ml.proto
Generated: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/onnx-build/onnx/onnx-operators-ml.proto
Generated: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/onnx-build/onnx/onnx-data.proto

-- ******** Summary ********
-- CMake version : 3.28.0
-- CMake command : D:/cmake-3.28.0-windows-x86_64/bin/cmake.exe
-- System : Android
-- C++ compiler : D:/Android/SDK/ndk/28.0.12433566/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe
-- C++ compiler version : 19.0.0
-- CXX flags : -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -ffunction-sections -fdata-sections -DCPUINFO_SUPPORTED -Wnon-virtual-dtor
-- Build type : Debug
-- Compile definitions : ORT_ENABLE_STREAM;EIGEN_MPL2_ONLY;__STDC_FORMAT_MACROS
-- CMAKE_PREFIX_PATH : E:\onnxruntime\onnxruntime\build\Windows/Debug/installed;D:/Android/SDK/ndk/28.0.12433566/toolchains/llvm/prebuilt/windows-x86_64
-- CMAKE_INSTALL_PREFIX : C:/Program Files (x86)/onnxruntime
-- CMAKE_MODULE_PATH : E:/onnxruntime/onnxruntime/cmake/external

-- ONNX version : 1.16.1
-- ONNX NAMESPACE : onnx
-- ONNX_USE_LITE_PROTO : ON
-- USE_PROTOBUF_SHARED_LIBS : OFF
-- Protobuf_USE_STATIC_LIBS : ON
-- ONNX_DISABLE_EXCEPTIONS : OFF
-- ONNX_DISABLE_STATIC_REGISTRATION : OFF
-- ONNX_WERROR : OFF
-- ONNX_BUILD_TESTS : OFF
-- ONNX_BUILD_BENCHMARKS : OFF
-- ONNX_BUILD_SHARED_LIBS :
-- BUILD_SHARED_LIBS : OFF

-- Protobuf compiler :
-- Protobuf includes :
-- Protobuf libraries :
-- BUILD_ONNX_PYTHON : OFF
-- Could NOT find Eigen3 (missing: Eigen3_DIR)
-- Populating eigen
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: E:/onnxruntime/onnxruntime/build/Windows/Debug/_deps/eigen-subbuild
ninja: no work to do.
-- Finished fetching external dependencies
NVCC_ERROR =
NVCC_OUT = no such file or directory
-- Java Build is enabled
-- GRADLE_ARGS: --console=plain;cmakeBuild;-DcmakeBuildDir=E:/onnxruntime/onnxruntime/build/Windows/Debug;--no-daemon
-- Enabling Java tests
-- Configuring done (3.2s)
-- Generating done (0.2s)
-- Build files have been written to: E:/onnxruntime/onnxruntime/build/Windows/Debug
2024-11-14 10:41:56,599 build [INFO] - Building targets for Debug configuration
2024-11-14 10:41:56,599 build [INFO] - D:\cmake-3.28.0-windows-x86_64\bin\cmake.EXE --build E:\onnxruntime\onnxruntime\build\Windows\Debug --config Debug
[0/2] Re-checking globbed directories...
[1/3] Generating E:/onnxruntime/onnxruntime/java/build/libs/onnxruntime.jar
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/6.9.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build

Configure project :
cmakeBuildDir is not set. Skipping cmake tasks.

Task :clean
Task :spotlessJava
Task :compileJava
Task :processResources NO-SOURCE
Task :classes
Task :jar

BUILD SUCCESSFUL in 4s
4 actionable tasks: 4 executed
[2/3] Linking C shared module libonnxruntime4j_jni.so
FAILED: libonnxruntime4j_jni.so
C:\Windows\system32\cmd.exe /C "cd . && D:\Android\SDK\ndk\28.0.12433566\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=armv7-none-linux-androideabi21 --sysroot=D:/Android/SDK/ndk/28.0.12433566/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 -march=armv7-a -mthumb -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/E_/onnxruntime/onnxruntime/java/src/main/native/OrtJniUtil.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OnnxMap.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OnnxRuntime.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OnnxSequence.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OnnxSparseTensor.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OnnxTensor.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtAllocator.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtEnvironment.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtEnvironment_ThreadingOptions.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtLoraAdapter.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtSession.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtSession_RunOptions.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtSession_SessionOptions.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtTrainingSession.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtTrainingSession_OrtCheckpointState.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_providers_OrtCUDAProviderOptions.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_providers_OrtTensorRTProviderOptions.c.o libonnxruntime.so -latomic -lm && C:\Windows\system32\cmd.exe /C "cd /D E:\onnxruntime\onnxruntime\build\Windows\Debug && D:\cmake-3.28.0-windows-x86_64\bin\cmake.exe -E copy_if_different E:/onnxruntime/onnxruntime/build/Windows/Debug/libonnxruntime.so E:/onnxruntime/onnxruntime/build/Windows/Debug/java/native-lib/ai/onnxruntime/native/android-armeabi-v7a/libonnxruntime.so && cd /D E:\onnxruntime\onnxruntime\build\Windows\Debug && D:\cmake-3.28.0-windows-x86_64\bin\cmake.exe -E copy_if_different E:/onnxruntime/onnxruntime/build/Windows/Debug/libonnxruntime4j_jni.so E:/onnxruntime/onnxruntime/build/Windows/Debug/java/native-jni/ai/onnxruntime/native/android-armeabi-v7a/libonnxruntime4j_jni.so && cd /D E:\onnxruntime\onnxruntime\java && E:\onnxruntime\onnxruntime\java\gradlew --console=plain cmakeBuild -DcmakeBuildDir=E:/onnxruntime/onnxruntime/build/Windows/Debug --no-daemon && cd /D E:\onnxruntime\onnxruntime\build\Windows\Debug && D:\cmake-3.28.0-windows-x86_64\bin\cmake.exe -E copy_if_different E:/onnxruntime/onnxruntime/build/Windows/Debug/libonnxruntime.so E:/onnxruntime/onnxruntime/build/Windows/Debug/java/android/armeabi-v7a/libonnxruntime.so && cd /D E:\onnxruntime\onnxruntime\build\Windows\Debug && D:\cmake-3.28.0-windows-x86_64\bin\cmake.exe -E copy_if_different E:/onnxruntime/onnxruntime/build/Windows/Debug/libonnxruntime4j_jni.so E:/onnxruntime/onnxruntime/build/Windows/Debug/java/android/armeabi-v7a/libonnxruntime4j_jni.so && cd /D E:\onnxruntime\onnxruntime\java && D:\cmake-3.28.0-windows-x86_64\bin\cmake.exe -E echo "Generating Android AAR package..." && E:\onnxruntime\onnxruntime\java\gradlew build -b build-android.gradle -c settings-android.gradle -DjniLibsDir=E:/onnxruntime/onnxruntime/build/Windows/Debug/java/android -DbuildDir=E:/onnxruntime/onnxruntime/build/Windows/Debug/java/build/android -DminSdkVer=19 -DheadersDir=E:/onnxruntime/onnxruntime/build/Windows/Debug/android/headers --stacktrace && cd /D E:\onnxruntime\onnxruntime\build\Windows\Debug && D:\cmake-3.28.0-windows-x86_64\bin\cmake.exe -E copy_if_different E:/onnxruntime/onnxruntime/build/Windows/Debug/java/build/android/outputs/aar/onnxruntime-debug.aar E:/onnxruntime/onnxruntime/build/Windows/Debug/java/androidtest/android/app/libs/onnxruntime-android.aar && cd /D E:\onnxruntime\onnxruntime\build\Windows\Debug\java\androidtest\android && D:\cmake-3.28.0-windows-x86_64\bin\cmake.exe -E echo "Building and running Android test for Android AAR package..." && E:\onnxruntime\onnxruntime\java\gradlew clean assembleDebug assembleDebugAndroidTest -DminSdkVer=19 --stacktrace""
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/6.9.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build

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 21s
8 actionable tasks: 6 executed, 2 up-to-date
Generating Android AAR package...

Configure project :
Version code for 1.21.0 is 12100400
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/04 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01

Task :preBuild UP-TO-DATE
Task :preDebugBuild UP-TO-DATE
Task :compileDebugAidl NO-SOURCE
Task :mergeDebugJniLibFolders UP-TO-DATE
Task :mergeDebugNativeLibs UP-TO-DATE
Task :stripDebugDebugSymbols UP-TO-DATE
Task :copyDebugJniLibsProjectAndLocalJars UP-TO-DATE
Task :compileDebugRenderscript NO-SOURCE
Task :generateDebugBuildConfig UP-TO-DATE
Task :generateDebugResValues UP-TO-DATE
Task :generateDebugResources UP-TO-DATE
Task :packageDebugResources UP-TO-DATE
Task :parseDebugLocalResources UP-TO-DATE
Task :processDebugManifest UP-TO-DATE
Task :generateDebugRFile UP-TO-DATE
Task :javaPreCompileDebug UP-TO-DATE
Task :compileDebugJavaWithJavac UP-TO-DATE
Task :extractDebugAnnotations UP-TO-DATE
Task :mergeDebugGeneratedProguardFiles UP-TO-DATE
Task :mergeDebugConsumerProguardFiles UP-TO-DATE
Task :mergeDebugShaders UP-TO-DATE
Task :compileDebugShaders NO-SOURCE
Task :generateDebugAssets UP-TO-DATE
Task :packageDebugAssets UP-TO-DATE
Task :packageDebugRenderscript NO-SOURCE
Task :prepareLintJarForPublish UP-TO-DATE
Task :processDebugJavaRes NO-SOURCE
Task :mergeDebugJavaResource UP-TO-DATE
Task :syncDebugLibJars UP-TO-DATE
Task :writeDebugAarMetadata UP-TO-DATE
Task :bundleDebugAar UP-TO-DATE
Task :compileDebugSources UP-TO-DATE
Task :assembleDebug UP-TO-DATE
Task :preReleaseBuild UP-TO-DATE
Task :compileReleaseAidl NO-SOURCE
Task :mergeReleaseJniLibFolders UP-TO-DATE
Task :mergeReleaseNativeLibs UP-TO-DATE
Task :stripReleaseDebugSymbols UP-TO-DATE
Task :copyReleaseJniLibsProjectAndLocalJars UP-TO-DATE
Task :compileReleaseRenderscript NO-SOURCE
Task :generateReleaseBuildConfig UP-TO-DATE
Task :generateReleaseResValues UP-TO-DATE
Task :generateReleaseResources UP-TO-DATE
Task :packageReleaseResources UP-TO-DATE
Task :parseReleaseLocalResources UP-TO-DATE
Task :processReleaseManifest UP-TO-DATE
Task :generateReleaseRFile UP-TO-DATE
Task :javaPreCompileRelease UP-TO-DATE
Task :compileReleaseJavaWithJavac UP-TO-DATE
Task :extractReleaseAnnotations UP-TO-DATE
Task :mergeReleaseGeneratedProguardFiles UP-TO-DATE
Task :mergeReleaseConsumerProguardFiles UP-TO-DATE
Task :mergeReleaseShaders UP-TO-DATE
Task :compileReleaseShaders NO-SOURCE
Task :generateReleaseAssets UP-TO-DATE
Task :packageReleaseAssets UP-TO-DATE
Task :packageReleaseRenderscript NO-SOURCE
Task :processReleaseJavaRes NO-SOURCE
Task :mergeReleaseJavaResource UP-TO-DATE
Task :syncReleaseLibJars UP-TO-DATE
Task :writeReleaseAarMetadata UP-TO-DATE
Task :bundleReleaseAar UP-TO-DATE
Task :compileReleaseSources UP-TO-DATE
Task :mergeReleaseResources UP-TO-DATE
Task :verifyReleaseResources UP-TO-DATE
Task :assembleRelease UP-TO-DATE
Task :javadoc
Task :javadocJar
Task :sourcesJar
Task :assemble

Task :lint FAILED
Ran lint on variant debug: 42 issues found
Ran lint on variant release: 42 issues found

FAILURE: Build failed with an exception.

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

Lint infrastructure error
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.android.tools.lint.gradle.api.ReflectiveLintRunner.runLint(ReflectiveLintRunner.kt:37)
at com.android.build.gradle.tasks.LintBaseTask.runLint(LintBaseTask.java:133)
at com.android.build.gradle.tasks.LintGlobalTask.doTaskAction(LintGlobalTask.java:37)
at com.android.build.gradle.internal.tasks.NonIncrementalGlobalTask$taskAction$$inlined$recordTaskAction$1.invoke(BaseTask.kt:63)
.......
at com.android.tools.lint.gradle.LintGradleExecution.lintAllVariants(LintGradleExecution.kt:428)
at com.android.tools.lint.gradle.LintGradleExecution.analyze(LintGradleExecution.kt:74)
... 141 more

  • Try:
    Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':lint'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$3(ExecuteActionsTaskExecuter.java:186)
    at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:268)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:184)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:173)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
    ......
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    at java.lang.Thread.run(Thread.java:748)
    Caused by: java.lang.NullPointerException
    at com.intellij.openapi.util.KeyedExtensionCollector.getPoint(KeyedExtensionCollector.java:203)
    at com.intellij.openapi.util.KeyedExtensionCollector.getExtensions(KeyedExtensionCollector.java:135)
    at com.intellij.openapi.util.KeyedExtensionCollector.buildExtensions(KeyedExtensionCollector.java:124)
    at com.intellij.openapi.util.KeyedExtensionCollector.forKey(KeyedExtensionCollector.java:109)
    at com.intellij.openapi.vfs.impl.VirtualFileManagerImpl.getFileSystem(VirtualFileManagerImpl.java:107)
    at com.intellij.openapi.vfs.StandardFileSystems$1.compute(StandardFileSystems.java:24)
    at com.intellij.openapi.vfs.StandardFileSystems$1.compute(StandardFileSystems.java:20)
    at com.intellij.openapi.util.ClearableLazyValue.getValue(ClearableLazyValue.java:39)
    at com.intellij.openapi.vfs.StandardFileSystems.local(StandardFileSystems.java:40)
    at com.android.tools.lint.LintCliClient.readFile(LintCliClient.kt:547)
    at com.android.tools.lint.LintCliClient$getSourceText$1.apply(LintCliClient.kt:479)
    at com.android.tools.lint.LintCliClient$getSourceText$1.apply(LintCliClient.kt:116)
    at java.util.HashMap.computeIfAbsent(HashMap.java:1127)
    at com.android.tools.lint.LintCliClient.getSourceText(LintCliClient.kt:479)
    at com.android.tools.lint.HtmlReporter$writeIssueCard$1.invoke(HtmlReporter.kt:259)
    at com.android.tools.lint.HtmlReporter$writeIssueCard$1.invoke(HtmlReporter.kt:56)
    at com.android.tools.lint.HtmlReporter.writeCard(HtmlReporter.kt:764)
    at com.android.tools.lint.HtmlReporter.writeIssueCard(HtmlReporter.kt:175)
    at com.android.tools.lint.HtmlReporter.write(HtmlReporter.kt:120)
    at com.android.tools.lint.gradle.LintGradleExecution.lintAllVariants(LintGradleExecution.kt:428)
    at com.android.tools.lint.gradle.LintGradleExecution.analyze(LintGradleExecution.kt:74)
    ... 141 more

      at com.android.tools.lint.gradle.api.ReflectiveLintRunner.wrapExceptionAsString(ReflectiveLintRunner.kt:77)
      at com.android.tools.lint.gradle.api.ReflectiveLintRunner.runLint(ReflectiveLintRunner.kt:43)
      at com.android.build.gradle.tasks.LintBaseTask.runLint(LintBaseTask.java:133)
      at com.android.build.gradle.tasks.LintGlobalTask.doTaskAction(LintGlobalTask.java:37)
      at com.android.build.gradle.internal.tasks.NonIncrementalGlobalTask$taskAction$$inlined$recordTaskAction$1.invoke(BaseTask.kt:63)
      at com.android.build.gradle.internal.tasks.Blocks.recordSpan(Blocks.java:51)
      at com.android.build.gradle.internal.tasks.NonIncrementalGlobalTask.taskAction(NonIncrementalTask.kt:90)
      at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
      at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
      at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
      at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.run(ExecuteActionsTaskExecuter.java:494)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
      at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:479)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:462)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$400(ExecuteActionsTaskExecuter.java:105)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:273)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:251)
      at org.gradle.internal.execution.steps.ExecuteStep.lambda$executeOperation$1(ExecuteStep.java:66)
      at org.gradle.internal.execution.steps.ExecuteStep.executeOperation(ExecuteStep.java:66)
      at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:34)
      at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:47)
      at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:44)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
      at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
      at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:44)
      at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:34)
      at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:72)
      at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:42)
      at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:53)
      at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:39)
      at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:44)
      at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:77)
      at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:58)
      at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:54)
      at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:32)
      at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:57)
      at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:38)
      at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:63)
      at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:30)
      at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:176)
      at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:76)
      at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:47)
      at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:43)
      at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:32)
      at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:39)
      at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:25)
      at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:102)
      at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:95)
      at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
      at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39)
      at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:83)
      at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:44)
      at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
      at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
      at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:96)
      at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:52)
      at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:83)
      at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:54)
      at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74)
      at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:88)
      at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:88)
      at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
      at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
      at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:46)
      at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:34)
      at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:43)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution$3.withWorkspace(ExecuteActionsTaskExecuter.java:286)
      at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:43)
      at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:33)
      at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:40)
      at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:30)
      at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:54)
      at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:40)
      at org.gradle.internal.execution.impl.DefaultExecutionEngine.rebuild(DefaultExecutionEngine.java:46)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$0(ExecuteActionsTaskExecuter.java:182)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:182)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:173)
      at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
      at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
      at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
      at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
      at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
      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:200)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
      at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
      at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:411)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:398)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:391)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:377)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
      at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    
  • Get more help at https://help.gradle.org

BUILD FAILED in 4s
49 actionable tasks: 4 executed, 45 up-to-date
ninja: build stopped: subcommand failed.
Namespace(build_dir='E:\onnxruntime\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, disable_cuda_nhwc_ops=False, enable_pybind=False, build_wheel=False, wheel_name_suffix=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=False, 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='armeabi-v7a', android_api=19, android_sdk_path='D:\Android\SDK', android_ndk_path='D:\Android\SDK\ndk\28.0.12433566', android_cpp_shared=False, android_run_emulator=False, use_gdk=False, gdk_edition='.', gdk_platform='Scarlett', enable_wasm_memory64=False, 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, use_vcpkg=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_webgpu=False, use_external_dawn=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=False, 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_avx512=False, use_azure=False, use_cache=False, use_triton_kernel=False, use_lock_free_queue=False)
Traceback (most recent call last):
File "E:\onnxruntime\onnxruntime\tools\ci_build\build.py", line 3011, in
sys.exit(main())
^^^^^^
File "E:\onnxruntime\onnxruntime\tools\ci_build\build.py", line 2901, in main
build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target)
File "E:\onnxruntime\onnxruntime\tools\ci_build\build.py", line 1752, in build_targets
run_subprocess(cmd_args, env=env)
File "E:\onnxruntime\onnxruntime\tools\ci_build\build.py", line 879, in run_subprocess
return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\onnxruntime\onnxruntime\tools\python\util\run.py", line 49, in run
completed_process = subprocess.run(
^^^^^^^^^^^^^^^
File "C:\Users\admin\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['D:\cmake-3.28.0-windows-x86_64\bin\cmake.EXE', '--build', 'E:\onnxruntime\onnxruntime\\build\Windows\Debug', '--config', 'Debug']' returned non-zero exit status 1.

Urgency

No response

Target platform

Android4.4

Build script

./build.bat --android --android_sdk_path D:/Android/SDK --android_ndk_path D:/Android/SDK/ndk/28.0.12433566 --android_abi armeabi-v7a --android_api 19 --cmake_generator Ninja --build_java

Error / output

4 actionable tasks: 4 executed
[2/3] Linking C shared module libonnxruntime4j_jni.so
FAILED: libonnxruntime4j_jni.so
C:\Windows\system32\cmd.exe /C "cd . && D:\Android\SDK\ndk\28.0.12433566\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=armv7-none-linux-androideabi21 --sysroot=D:/Android/SDK/ndk/28.0.12433566/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 -march=armv7-a -mthumb -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/E_/onnxruntime/onnxruntime/java/src/main/native/OrtJniUtil.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OnnxMap.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OnnxRuntime.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OnnxSequence.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OnnxSparseTensor.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OnnxTensor.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtAllocator.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtEnvironment.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtEnvironment_ThreadingOptions.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtLoraAdapter.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtSession.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtSession_RunOptions.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtSession_SessionOptions.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtTrainingSession.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_OrtTrainingSession_OrtCheckpointState.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_providers_OrtCUDAProviderOptions.c.o CMakeFiles/onnxruntime4j_jni.dir/E_/onnxruntime/onnxruntime/java/src/main/native/ai_onnxruntime_providers_OrtTensorRTProviderOptions.c.o libonnxruntime.so -latomic -lm && C:\Windows\system32\cmd.exe /C "cd /D E:\onnxruntime\onnxruntime\build\Windows\Debug && D:\cmake-3.28.0-windows-x86_64\bin\cmake.exe -E copy_if_different E:/onnxruntime/onnxruntime/build/Windows/Debug/libonnxruntime.so E:/onnxruntime/onnxruntime/build/Windows/Debug/java/native-lib/ai/onnxruntime/native/android-armeabi-v7a/libonnxruntime.so && cd /D E:\onnxruntime\onnxruntime\build\Windows\Debug && D:\cmake-3.28.0-windows-x86_64\bin\cmake.exe -E copy_if_different E:/onnxruntime/onnxruntime/build/Windows/Debug/libonnxruntime4j_jni.so E:/onnxruntime/onnxruntime/build/Windows/Debug/java/native-jni/ai/onnxruntime/native/android-armeabi-v7a/libonnxruntime4j_jni.so && cd /D E:\onnxruntime\onnxruntime\java && E:\onnxruntime\onnxruntime\java\gradlew --console=plain cmakeBuild -DcmakeBuildDir=E:/onnxruntime/onnxruntime/build/Windows/Debug --no-daemon && cd /D E:\onnxruntime\onnxruntime\build\Windows\Debug && D:\cmake-3.28.0-windows-x86_64\bin\cmake.exe -E copy_if_different E:/onnxruntime/onnxruntime/build/Windows/Debug/libonnxruntime.so E:/onnxruntime/onnxruntime/build/Windows/Debug/java/android/armeabi-v7a/libonnxruntime.so && cd /D E:\onnxruntime\onnxruntime\build\Windows\Debug && D:\cmake-3.28.0-windows-x86_64\bin\cmake.exe -E copy_if_different E:/onnxruntime/onnxruntime/build/Windows/Debug/libonnxruntime4j_jni.so E:/onnxruntime/onnxruntime/build/Windows/Debug/java/android/armeabi-v7a/libonnxruntime4j_jni.so && cd /D E:\onnxruntime\onnxruntime\java && D:\cmake-3.28.0-windows-x86_64\bin\cmake.exe -E echo "Generating Android AAR package..." && E:\onnxruntime\onnxruntime\java\gradlew build -b build-android.gradle -c settings-android.gradle -DjniLibsDir=E:/onnxruntime/onnxruntime/build/Windows/Debug/java/android -DbuildDir=E:/onnxruntime/onnxruntime/build/Windows/Debug/java/build/android -DminSdkVer=19 -DheadersDir=E:/onnxruntime/onnxruntime/build/Windows/Debug/android/headers --stacktrace && cd /D E:\onnxruntime\onnxruntime\build\Windows\Debug && D:\cmake-3.28.0-windows-x86_64\bin\cmake.exe -E copy_if_different E:/onnxruntime/onnxruntime/build/Windows/Debug/java/build/android/outputs/aar/onnxruntime-debug.aar E:/onnxruntime/onnxruntime/build/Windows/Debug/java/androidtest/android/app/libs/onnxruntime-android.aar && cd /D E:\onnxruntime\onnxruntime\build\Windows\Debug\java\androidtest\android && D:\cmake-3.28.0-windows-x86_64\bin\cmake.exe -E echo "Building and running Android test for Android AAR package..." && E:\onnxruntime\onnxruntime\java\gradlew clean assembleDebug assembleDebugAndroidTest -DminSdkVer=19 --stacktrace""
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/6.9.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build

Visual Studio Version

No response

GCC / Compiler Version

28

@Lutan701 Lutan701 added the build build issues; typically submitted using template label Nov 14, 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 labels Nov 14, 2024
@Lutan701
Copy link
Author

but In dir <build_dir>\build\Windows\Debug\java\android\armeabi-v7a have libonnxruntime.so and libonnxruntime4j_jni.so.

After using it in our project, the following problems occurred:

java.lang.UnsatisfiedLinkError: dlopen failed: could not load library "libonnxruntime.so" needed by "libonnxruntime4j_jni.so"; caused by cannot locate symbol "localeconv" referenced by "libonnxruntime.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:364)
at java.lang.System.loadLibrary(System.java:526)
at ai.onnxruntime.OnnxRuntime.load(OnnxRuntime.java:315)
at ai.onnxruntime.OnnxRuntime.init(OnnxRuntime.java:162)
at ai.onnxruntime.OrtEnvironment.<clinit>(OrtEnvironment.java:35)
at com.biohit.hit92a.Predict.predict(Predict.kt:14)
at com.biohit.hit92a.HitApplication.onCreate(HitApplication.kt:166)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4344)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)

@Craigacp
Copy link
Contributor

Android 4.4 doesn't support Java 8, which is the minimum version for the ORT Java API.

@snnn snnn closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 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
Projects
None yet
Development

No branches or pull requests

3 participants