From 5ed035fc2e22843803e0ef06c78d4978e18cb350 Mon Sep 17 00:00:00 2001 From: adrianlizarraga Date: Fri, 20 Dec 2024 15:29:21 -0800 Subject: [PATCH] consistent library loading logic for java android --- java/src/main/java/ai/onnxruntime/OnnxRuntime.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/java/src/main/java/ai/onnxruntime/OnnxRuntime.java b/java/src/main/java/ai/onnxruntime/OnnxRuntime.java index 742805bebc0fd..c4500a6a2178d 100644 --- a/java/src/main/java/ai/onnxruntime/OnnxRuntime.java +++ b/java/src/main/java/ai/onnxruntime/OnnxRuntime.java @@ -162,13 +162,8 @@ static synchronized void init() throws IOException { // the ONNX Runtime native library will load it extractProviderLibrary(ONNXRUNTIME_LIBRARY_SHARED_NAME); - if (isAndroid()) { - // On Android, we only need to load onnxruntime4j_jni with System.loadLibrary - System.loadLibrary(ONNXRUNTIME_JNI_LIBRARY_NAME); - } else { - load(ONNXRUNTIME_LIBRARY_NAME); - load(ONNXRUNTIME_JNI_LIBRARY_NAME); - } + load(ONNXRUNTIME_LIBRARY_NAME); + load(ONNXRUNTIME_JNI_LIBRARY_NAME); ortApiHandle = initialiseAPIBase(ORT_API_VERSION_14); if (ortApiHandle == 0L) {