Unable to generate build with pro guard enabled us

2019-03-01 05:07发布

问题:

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.

回答1:

Try adding the below lines in proguard file

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