- 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
20 lines
568 B
Prolog
20 lines
568 B
Prolog
# By default, the flags in this file are appended to flags specified
|
|
# in ../sdk/tools/proguard/proguard-android.txt,
|
|
# contents of this file will be appended into proguard-android.txt
|
|
|
|
# Square okio, ignoring warnings,
|
|
# see https://github.com/square/okio/issues/60
|
|
-dontwarn okio.**
|
|
|
|
# Package: annotations
|
|
-keep class com.mapbox.mapboxsdk.annotations.** { *; }
|
|
|
|
# Package: geometry
|
|
-keep class com.mapbox.mapboxsdk.geometry.** { *; }
|
|
|
|
# Package: http
|
|
-keep class com.mapbox.mapboxsdk.http.** { *; }
|
|
|
|
# Package views
|
|
-keep class com.mapbox.mapboxsdk.views.** { *; }
|