Removing the Google Play dependency
Starting from v11.8.0, the Mapbox Maps SDK for Android depends on Chromium's HTTP client Cronet to enable HTTP/3, and will bring a transitive dependency on Google Play Services, which is used as a provider to get Cronet.
If your application will be deployed in an environment where Google Play Services is not available, it is possible to remove the dependency on Google Play Services from the build through an exclusion, by using this code when adding the dependency:
dependencies {
implementation('com.mapbox.maps:android:11.10.2') {
exclude group: 'com.google.android.gms', module: 'play-services-cronet'
}
}
dependencies {
implementation("com.mapbox.maps:android:11.10.2") {
exclude(group = "com.google.android.gms", module = "play-services-cronet")
}
}
After doing this there are two alternatives:
-
(Recommended) Have the application depend on cronet-embedded, which will bundle Cronet along with the application during compilation. This will allow the SDK to bring the benefits of HTTP/3, although it will increase the application size.
-
Let the SDK use its fallback HTTP client (no action needed, it will be automatically selected at runtime when Cronet is not available). The fallback HTTP client is still highly performant, but supports only up to HTTP/2.