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 {
78
78
if (file .exists ()) {
79
79
System .load (file .getAbsolutePath ());
80
80
} else {
81
- if (!android ) {
82
- System .err .println ("File not available: " + file .getAbsolutePath ());
83
- }
84
81
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 ());
86
89
System .loadLibrary (libname );
87
90
}
88
91
} catch (UnsatisfiedLinkError e ) {
89
92
if (!android && isLinux ) {
90
93
// maybe is Android, but check failed: try loading Android lib
91
- if (!loadLibraryAndroid ()) {
94
+ boolean success = loadLibraryAndroid ();
95
+ if (!success ) {
92
96
System .loadLibrary (OBJECTBOX_JNI );
93
97
}
94
98
} else {
@@ -138,7 +142,6 @@ private static void checkUnpackLib(String filename) {
138
142
}
139
143
}
140
144
141
- @ SuppressWarnings ("BooleanMethodIsAlwaysInverted" ) // more readable
142
145
private static boolean loadLibraryAndroid () {
143
146
if (BoxStore .context == null ) {
144
147
return false ;
You can’t perform that action at this time.
0 commit comments