Skip to content

Commit

Permalink
consistent library loading logic for java android
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianlizarraga committed Dec 20, 2024
1 parent 3e39b88 commit 5ed035f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions java/src/main/java/ai/onnxruntime/OnnxRuntime.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5ed035f

Please sign in to comment.