Skip to content

Commit

Permalink
build(android): add telemetry dependency to default build setup (#1550)
Browse files Browse the repository at this point in the history
* build(android): add telemetry dependency to default build setup

* docs: update CHANGELOG

* docs(android): update install guide
  • Loading branch information
ferdicus authored Sep 24, 2021
1 parent 273a2e5 commit d07f296
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ PR Title ([#123](link to my pr))
Update ShapeSource methods to make it usable with any cluster ( Use cluster itself instead of cluster_id as first argument for getClusterExpansionZoom/getClusterLeaves/getClusterChildren methods. Version < 9 methods still supports passing cluster_id as a first argument but a deprecation warning will be shown. ) ([#1499](https://github.com/react-native-mapbox-gl/maps/pull/1499))
```

build(android): add telemetry dependency to default build setup ([#1550](https://github.com/react-native-mapbox-gl/maps/pull/1550))
fix: revert pinned mapLibre version to `5.11.0` ([8a2b00e67ba6398f3f6e6f52e98b0f0cea437e4d](https://github.com/react-native-mapbox-gl/maps/commit/8a2b00e67ba6398f3f6e6f52e98b0f0cea437e4d))

---
Expand Down
27 changes: 6 additions & 21 deletions android/install.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,19 @@
# Android Installation

## React-Native > `0.60.0`
If you are using autolinking feature introduced in React-Native `0.60.0` you do not need any additional steps.

Notice, that if you're using the default Mapbox Android SDK (which is packed in with this lib)
and are on newer Android OS version (API 30+),
you'll encounter [`Fatal Exception: java.lang.SecurityException: getDataNetworkTypeForSubscriber`](https://github.com/react-native-mapbox-gl/maps/issues/1286).
## React-Native > `0.60.0`

Either update the Mapbox Android SDK as described below in the [`Mapbox Maps SDK`](https://github.com/react-native-mapbox-gl/maps/blob/master/android/install.md#mapbox-maps-sdk) section,
_OR_ add the following line to your `android/app/build.gradle` to pull in the missing dependency.

```
dependencies {
// ...
implementation 'com.mapbox.mapboxsdk:mapbox-android-telemetry:6.1.0'
// ...
}
```
If you are using autolinking feature introduced in React-Native `0.60.0` you do not need any additional steps.

<br>

## Mapbox Maps SDK

It is possible to set a custom version of the Mapbox SDK


Add the following to your `android/build.gradle`:
Add the following to your `android/build.gradle`:

under section `allprojects/repositories`

```groovy
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
Expand All @@ -36,7 +22,7 @@ under section `allprojects/repositories`
}
credentials {
// Do not change the username below.
// This should always be `mapbox` (not your username).
// This should always be `mapbox` (not your username).
username = 'mapbox'
// Use the secret token you stored in gradle.properties as the password
password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
Expand All @@ -48,7 +34,7 @@ Overwrite mapbox dependencies within your `android/app/build.gradle`:

```groovy
dependencies {
// ...
// ...
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.6.1'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:5.6.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
Expand All @@ -57,7 +43,6 @@ dependencies {

Check the current version of the SDK [here](https://docs.mapbox.com/android/maps/guides/).


If you are using newer versions of the SDK, you will need to authorize your download of the Maps SDK via a secret access token with the `DOWNLOADS:READ` scope.
This [guide](https://docs.mapbox.com/android/maps/guides/install/#configure-credentials) explains how to configure the secret token under section `Configure your secret token`.

Expand Down
1 change: 1 addition & 0 deletions android/rctmgl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ dependencies {
customizableDependencies('rnmbglMapboxLibs') {
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:5.1.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.1.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-telemetry:6.1.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.8.0'
}

Expand Down

0 comments on commit d07f296

Please sign in to comment.