diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2019-01-21 17:23:56 +0100 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2019-01-21 19:52:46 +0100 |
commit | 4b254dc99430ff6ce16bc767d7c9f1555ddf527e (patch) | |
tree | 2bcdc7a8a401be4773dbd2058a253938594250f9 /platform | |
parent | 9604953d9080a4d79f72f60ce799ef05425b1ffc (diff) | |
download | qtlocation-mapboxgl-4b254dc99430ff6ce16bc767d7c9f1555ddf527e.tar.gz |
[android] - use ReLinker as default library loader for the test app
Diffstat (limited to 'platform')
3 files changed, 17 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/build.gradle b/platform/android/MapboxGLAndroidSDKTestApp/build.gradle index 386361520d..cc56e002f7 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/build.gradle +++ b/platform/android/MapboxGLAndroidSDKTestApp/build.gradle @@ -65,6 +65,7 @@ dependencies { implementation dependenciesList.supportConstraintLayout implementation dependenciesList.gmsLocation + implementation dependenciesList.reLinker implementation dependenciesList.timber debugImplementation dependenciesList.leakCanaryDebug releaseImplementation dependenciesList.leakCanaryRelease diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapboxApplication.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapboxApplication.java index 9ade97f91e..ab083ddc13 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapboxApplication.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapboxApplication.java @@ -4,6 +4,8 @@ import android.app.Application; import android.os.StrictMode; import android.text.TextUtils; +import com.getkeepsafe.relinker.ReLinker; +import com.mapbox.mapboxsdk.LibraryLoader; import com.mapbox.mapboxsdk.MapStrictMode; import com.mapbox.mapboxsdk.Mapbox; import com.mapbox.mapboxsdk.log.Logger; @@ -23,6 +25,7 @@ import static timber.log.Timber.DebugTree; */ public class MapboxApplication extends Application { + private static final String TAG = "MapboxApplication"; private static final String DEFAULT_MAPBOX_ACCESS_TOKEN = "YOUR_MAPBOX_ACCESS_TOKEN_GOES_HERE"; private static final String ACCESS_TOKEN_NOT_SET_MESSAGE = "In order to run the Test App you need to set a valid " + "access token. During development, you can set the MAPBOX_ACCESS_TOKEN environment variable for the SDK to " @@ -35,6 +38,7 @@ public class MapboxApplication extends Application { if (!initializeLeakCanary()) { return; } + initializeLibraryLoader(); initializeLogger(); initializeStrictMode(); initializeMapbox(); @@ -50,6 +54,15 @@ public class MapboxApplication extends Application { return true; } + private void initializeLibraryLoader() { + LibraryLoader.setLibraryLoader(new LibraryLoader() { + @Override + public void load(String name) { + ReLinker.log(message -> Logger.v(TAG, message)).loadLibrary(MapboxApplication.this, name); + } + }); + } + private void initializeLogger() { Logger.setLoggerDefinition(new TimberLogger()); if (BuildConfig.DEBUG) { diff --git a/platform/android/gradle/dependencies.gradle b/platform/android/gradle/dependencies.gradle index 1a55f1ee55..d6dad86f72 100644 --- a/platform/android/gradle/dependencies.gradle +++ b/platform/android/gradle/dependencies.gradle @@ -21,7 +21,8 @@ ext { kotlin : '1.3.11', licenses : '0.8.41', lint : '26.1.3', - gms : '16.0.0' + gms : '16.0.0', + reLinker : '1.3.1' ] vendorArtifacts = [ @@ -65,6 +66,7 @@ ext { okhttp3 : "com.squareup.okhttp3:okhttp:${versions.okhttp}", leakCanaryDebug : "com.squareup.leakcanary:leakcanary-android:${versions.leakCanary}", leakCanaryRelease : "com.squareup.leakcanary:leakcanary-android-no-op:${versions.leakCanary}", + reLinker : "com.getkeepsafe.relinker:relinker:${versions.reLinker}", kotlinLib : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${versions.kotlin}", kotlinPlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}", |