diff --git a/pythonforandroid/bootstraps/sdl2/build/src/org/kivy/android/PythonUtil.java b/pythonforandroid/bootstraps/sdl2/build/src/org/kivy/android/PythonUtil.java index 4b1f390d4f..a488a1b878 100644 --- a/pythonforandroid/bootstraps/sdl2/build/src/org/kivy/android/PythonUtil.java +++ b/pythonforandroid/bootstraps/sdl2/build/src/org/kivy/android/PythonUtil.java @@ -14,6 +14,8 @@ protected static String[] getLibraries() { "SDL2_image", "SDL2_mixer", "SDL2_ttf", + "python2.7", + "python3.5m", "main" }; } @@ -21,23 +23,20 @@ protected static String[] getLibraries() { public static void loadLibraries(File filesDir) { String filesDirPath = filesDir.getAbsolutePath(); + boolean skippedPython = false; for (String lib : getLibraries()) { - System.loadLibrary(lib); + try { + System.loadLibrary(lib); + } catch(UnsatisfiedLinkError e) { + if (lib.startsWith("python") && !skippedPython) { + skippedPython = true; + continue; + } + throw e; + } } - try { - System.loadLibrary("python2.7"); - } catch(UnsatisfiedLinkError e) { - Log.v(TAG, "Failed to load libpython2.7"); - } - - try { - System.loadLibrary("python3.5m"); - } catch(UnsatisfiedLinkError e) { - Log.v(TAG, "Failed to load libpython3.5m"); - } - try { System.load(filesDirPath + "/lib/python2.7/lib-dynload/_io.so"); System.load(filesDirPath + "/lib/python2.7/lib-dynload/unicodedata.so");