- 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
developer-config.xml gets generated on build time with the token
set for the env var MAPBOX_ACCESS_TOKEN. Because the file was checked to
the git repo, it was not being regenerated and thus, crashing the
test app accusing no token set.