Search code examples
mapboxmapbox-android

Unable to generate build with pro guard enabled using Mapbox SDK 6.7


Mapbox SDK: 6.7.0

After enabling the proguard in the gradle, we are getting the following error.

com.mapbox.services.android.location.LostLocationEngine: can't find superclass or interface com.mapbox.services.android.telemetry.location.LocationEngine   

com.mapbox.services.android.location.MockLocationEngine: can't find referenced class com.mapbox.services.android.telemetry.location.LocationEngine$Type

I have used LocationComponent, LocationEngine and LocationEngineProvider classes in my application. Do I need to add anything in proguard rules to generate a build with proguard enabled?

On commenting usages of these class, the build can be generated with proguard enabled.


Solution

  • Try adding the below lines in proguard file

    -dontwarn com.mapbox.services.android.location.LostLocationEngine
    -dontwarn com.mapbox.services.android.location.MockLocationEngine