summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorStephen Niedzielski <stephen@niedzielski.com>2015-12-04 19:15:05 -0700
committerTobrun <tobrun.van.nuland@gmail.com>2015-12-10 20:47:11 -0800
commit9747caa4358ae32e164912cae83aa2378ad97387 (patch)
tree149029cacfb127032c65cd5f7b189eb3a697ea98 /android
parent37ca365469725d322f4a1b8b7ff569435a0a05d3 (diff)
downloadqtlocation-mapboxgl-9747caa4358ae32e164912cae83aa2378ad97387.tar.gz
Fix Android ProGuard View rules & release signing
- Enable ProGuard for the test app so the most common use case may be tested. - Update ProGuard to keep all Mapbox views and their methods. Previously, ProGuard was stripping numerous class methods including UserLocationView.g/setAccuracy(). These particular methods are accessed via reflection. On newer APIs, this manifests only in Logcat and loss of functionality: PropertyValuesHolder W Method setAccuracy() with type float not found on target class class com.mapbox.mapboxsdk.views.UserLocationView W Method getAccuracy() with type null not found on target class class com.mapbox.mapboxsdk.views.UserLocationView On Android 4.03 and 4.04 (API 15), this causes an NPE: java.lang.NullPointerException at android.animation.PropertyValuesHolder.setupSetterAndGetter(PropertyValuesHolder.java:513) at android.animation.ObjectAnimator.initAnimation(ObjectAnimator.java:385) at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:537) at android.animation.ValueAnimator.start(ValueAnimator.java:927) at android.animation.ValueAnimator.start(ValueAnimator.java:950) at android.animation.ObjectAnimator.start(ObjectAnimator.java:363) at com.mapbox.mapboxsdk.views.UserLocationView.setLocation(UserLocationView.java:401) at com.mapbox.mapboxsdk.views.UserLocationView.toggleGps(UserLocationView.java:300) at com.mapbox.mapboxsdk.views.UserLocationView.setEnabled(UserLocationView.java:230) at com.mapbox.mapboxsdk.views.MapView.setMyLocationEnabled(MapView.java:3122) ... Also add Support libraries rules to the test. Further amendments may be made by examining usage.txt[0,1]. [0] http://developer.android.com/tools/help/proguard.html#enabling [1] http://proguard.sourceforge.net/manual/usage.html#shrinkingoptions
Diffstat (limited to 'android')
-rw-r--r--android/MapboxGLAndroidSDK/proguard-rules.pro7
-rw-r--r--android/MapboxGLAndroidSDKTestApp/build.gradle2
-rw-r--r--android/MapboxGLAndroidSDKTestApp/proguard-rules.pro4
3 files changed, 5 insertions, 8 deletions
diff --git a/android/MapboxGLAndroidSDK/proguard-rules.pro b/android/MapboxGLAndroidSDK/proguard-rules.pro
index 6853f3ddea..c805eee199 100644
--- a/android/MapboxGLAndroidSDK/proguard-rules.pro
+++ b/android/MapboxGLAndroidSDK/proguard-rules.pro
@@ -16,9 +16,4 @@
-keep class com.mapbox.mapboxsdk.http.** { *; }
# Package views
--keep class com.mapbox.mapboxsdk.views.MapView**
--keep class com.mapbox.mapboxsdk.views.NativeMapView**
--keepclassmembers class com.mapbox.mapboxsdk.views.NativeMapView** {
- *;
-}
-
+-keep class com.mapbox.mapboxsdk.views.** { *; }
diff --git a/android/MapboxGLAndroidSDKTestApp/build.gradle b/android/MapboxGLAndroidSDKTestApp/build.gradle
index bdb4837211..54b7a3b1dc 100644
--- a/android/MapboxGLAndroidSDKTestApp/build.gradle
+++ b/android/MapboxGLAndroidSDKTestApp/build.gradle
@@ -69,7 +69,7 @@ android {
buildTypes {
release {
- minifyEnabled false
+ minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
diff --git a/android/MapboxGLAndroidSDKTestApp/proguard-rules.pro b/android/MapboxGLAndroidSDKTestApp/proguard-rules.pro
index 578d946927..43a408f33e 100644
--- a/android/MapboxGLAndroidSDKTestApp/proguard-rules.pro
+++ b/android/MapboxGLAndroidSDKTestApp/proguard-rules.pro
@@ -1 +1,3 @@
-# Proguard configuration is handeld in the SDK \ No newline at end of file
+# Mapbox ProGuard configuration is handled in the SDK
+
+-keep class android.support.** { *; } \ No newline at end of file