Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(android): add telemetry dependency to default build setup #1550

Merged
merged 3 commits into from
Sep 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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