From 78ba38450b1f00009203bfe891da77681739f9d8 Mon Sep 17 00:00:00 2001 From: Antonio Zugaldia Date: Wed, 11 Oct 2017 08:35:19 -0400 Subject: [PATCH] revert to previous behavior, adding a safeguard for potential UnsatisfiedLinkError --- .../com/mapbox/mapboxsdk/LibraryLoader.java | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/LibraryLoader.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/LibraryLoader.java index 35b1e7cf6ab..a024f0ab701 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/LibraryLoader.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/LibraryLoader.java @@ -1,9 +1,5 @@ package com.mapbox.mapboxsdk; -import android.content.Context; - -import java.io.File; - import timber.log.Timber; /** @@ -11,8 +7,6 @@ */ public class LibraryLoader { - private static final String LIBRARY_NAME = "libmapbox-gl.so"; - /** * Loads "libmapbox-gl.so" native shared library. */ @@ -20,22 +14,7 @@ public static void load() { try { System.loadLibrary("mapbox-gl"); } catch (UnsatisfiedLinkError error) { - Context context = Mapbox.getApplicationContext(); - if (context != null) { - Timber.d("Loading %s from internal storage.", LIBRARY_NAME); - System.load(getLibraryLocation(context).getAbsolutePath()); - } + Timber.e(error, "Failed to load native shared library."); } } - - /** - * Returns a file in the app internal storage that may contain a locally cached copy - * of the Mapbox native library. - * - * @param context The application context - * @return a file object - */ - public static File getLibraryLocation(Context context) { - return new File(context.getFilesDir(), LIBRARY_NAME); - } }