mapbox-gl-native icon indicating copy to clipboard operation
mapbox-gl-native copied to clipboard

Dependency between mapbox-android-ui and mapbox-android-sdk

Open duncancarroll opened this issue 9 years ago • 1 comments

Platform: Android Mapbox SDK version: 5.1.0

Steps to trigger behavior

It appears there is some dependency between versions of mapbox-android-ui and mapbox-android-sdk that manifested in my case as a proguard issue and resultant build failure:

  1. Create a project with mapbox-android-ui < 2.1.3 (I used 2.0.0) and mapbox-android-sdk
  2. Supply minifyEnabled true
  3. Attempt to build

Expected behavior

Proguard should not throw any warnings or errors.

Actual behavior

Proguard will show the below warning, and oddly no amount of proguard rules seems to fix it. I wasn't able to dig too much further, but upon updating mapbox-android-ui to 2.1.3 the issue was resolved. It would be great to document the dependency between these libs if one exists (it may be there and I overlooked it.)

Warning: com.mapbox.mapboxsdk.location.LocationSource: can't find referenced method 'android.location.Location getLastLocation()' in program class com.mapzen.android.lost.api.FusedLocationProviderApi
Warning: com.mapbox.mapboxsdk.location.LocationSource: can't find referenced method 'void requestLocationUpdates(com.mapzen.android.lost.api.LocationRequest,com.mapzen.android.lost.api.LocationListener)' in program class com.mapzen.android.lost.api.FusedLocationProviderApi
Warning: com.mapbox.mapboxsdk.location.LocationSource: can't find referenced method 'void removeLocationUpdates(com.mapzen.android.lost.api.LocationListener)' in program class com.mapzen.android.lost.api.FusedLocationProviderApi

Warning: there were 3 unresolved references to program class members.
         Your input classes appear to be inconsistent.
         You may need to recompile the code.

duncancarroll avatar Jul 06 '17 22:07 duncancarroll

The issue shown above is due to a LOST dependency version mismatch. (with the latest SDK we shipped an older version of LOST. This one is getting stripped out with a newer version from the mapbox-android-ui depedency. You can look into this kind of changes with ./gradlew :module_name:dependencies and you will see that the LOST version that shipped with the SDK (v1.1.1) has been stripped. If you aren't able to update the mapbox-android-ui, you can always exclude the LOST module from that dependency. A bit more information on the topic in https://github.com/mapbox/mapbox-gl-native/issues/9408.

Closing as this is not actionable for us. Users will have to patch this from their end.

tobrun avatar Jul 07 '17 07:07 tobrun