File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
objectbox-java/src/main/java/io/objectbox/internal Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -78,17 +78,21 @@ public class NativeLibraryLoader {
7878 if (file .exists ()) {
7979 System .load (file .getAbsolutePath ());
8080 } else {
81- if (!android ) {
82- System .err .println ("File not available: " + file .getAbsolutePath ());
83- }
8481 try {
85- if (!android || !loadLibraryAndroid ()) { // if android && loadLibraryAndroid OK: done
82+ if (android ) {
83+ boolean success = loadLibraryAndroid ();
84+ if (!success ) {
85+ System .loadLibrary (libname );
86+ }
87+ } else {
88+ System .err .println ("File not available: " + file .getAbsolutePath ());
8689 System .loadLibrary (libname );
8790 }
8891 } catch (UnsatisfiedLinkError e ) {
8992 if (!android && isLinux ) {
9093 // maybe is Android, but check failed: try loading Android lib
91- if (!loadLibraryAndroid ()) {
94+ boolean success = loadLibraryAndroid ();
95+ if (!success ) {
9296 System .loadLibrary (OBJECTBOX_JNI );
9397 }
9498 } else {
@@ -138,7 +142,6 @@ private static void checkUnpackLib(String filename) {
138142 }
139143 }
140144
141- @ SuppressWarnings ("BooleanMethodIsAlwaysInverted" ) // more readable
142145 private static boolean loadLibraryAndroid () {
143146 if (BoxStore .context == null ) {
144147 return false ;
You can’t perform that action at this time.
0 commit comments