Skip to content

Commit 75e7fe6

Browse files
committed
feat: update navigation sdk package versions
1 parent 9841ea9 commit 75e7fe6

File tree

29 files changed

+3241
-2439
lines changed

29 files changed

+3241
-2439
lines changed

README.md

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This is the beta release of the Google Driver SDK package for React Native. It i
1212

1313
| | Android | iOS |
1414
| ------------------------------- | ------- | --------- |
15-
| **Minimum mobile OS supported** | SDK 23+ | iOS 15.0+ |
15+
| **Minimum mobile OS supported** | SDK 23+ | iOS 16.0+ |
1616

1717
* A React Native project
1818
* A Google Cloud project with the [Navigation SDK enabled](https://developers.google.com/maps/documentation/navigation/android-sdk/set-up-project) and the [Maps SDK for iOS enabled](https://developers.google.com/maps/documentation/navigation/ios-sdk/config)
@@ -58,11 +58,31 @@ android {
5858
}
5959
```
6060

61+
2. **Enable Core Library Desugaring**
62+
63+
Core library desugaring **must be enabled** for your Android project, regardless of your minSdkVersion.
64+
65+
To enable desugaring, update your `android/app/build.gradle` file:
66+
67+
```groovy
68+
android {
69+
...
70+
compileOptions {
71+
coreLibraryDesugaringEnabled true
72+
...
73+
}
74+
}
75+
76+
dependencies {
77+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.4'
78+
}
79+
```
80+
6181
### iOS
6282

6383
1. Set the iOS version in your application PodFile.
6484

65-
`platform: ios, '14.0'`
85+
`platform: ios, '16.0'`
6686

6787
## Usage
6888

@@ -189,31 +209,31 @@ To get the DriverSDK version being used, you can call the **getDriverSdkVersion*
189209
190210
### List of sample functions in ODRD
191211
192-
| Function | Description |
193-
| ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
194-
| `RidesharingDriverApi.initialize` | create the instance of RidesharingAPI. |
195-
| `RidesharingDriverApi.getRidesharingVehicleReporter` | Vehicle reporter for the vehicle that reports location and vehicle state to Fleet Engine. An app is allowed only one vehicle reporter. |
196-
| `RidesharingVehicleReporter.setLocationTrackingEnabled(boolean)` | Enable/disabled location tracking(logs). |
197-
| `RidesharingVehicleReporter.setVehicleState(VehicleState)` | Set vehicle state to Online/Offline to Fleet Engine.
198-
| `RidesharingVehicleReporter.setLocationReportingInterval(number)` | Set the reporting interval(seconds). |
199-
| `RidesharingDriverApi.getDriverSdkVersion()` | get native driversdk version. |
200-
| `RidesharingDriverApi.clearInstance()` | clear the api instance. |
201-
| `RidesharingDriverApi.setAbnormalTerminationReporting(boolean)` | enable/disable abnormal termination reporting. |
212+
| Function | Description |
213+
| ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
214+
| `RidesharingDriverApi.initialize` | create the instance of RidesharingAPI. |
215+
| `RidesharingDriverApi.getRidesharingVehicleReporter` | Vehicle reporter for the vehicle that reports location and vehicle state to Fleet Engine. An app is allowed only one vehicle reporter. |
216+
| `RidesharingVehicleReporter.setLocationTrackingEnabled(boolean)` | Enable/disabled location tracking(logs). |
217+
| `RidesharingVehicleReporter.setVehicleState(VehicleState)` | Set vehicle state to Online/Offline to Fleet Engine. |
218+
| `RidesharingVehicleReporter.setLocationReportingInterval(number)` | Set the reporting interval(seconds). |
219+
| `RidesharingDriverApi.getDriverSdkVersion()` | get native driversdk version. |
220+
| `RidesharingDriverApi.clearInstance()` | clear the api instance. |
221+
| `RidesharingDriverApi.setAbnormalTerminationReporting(boolean)` | enable/disable abnormal termination reporting. |
202222
203223
204224
### List of sample functions in LMFS
205225
206-
| Function | Description |
207-
| ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
208-
| `DeliveryDriverApi.initialize` | create the instance of DeliveryDriverAPI. |
209-
| `DeliveryDriverApi.getDeliveryVehicleReporter` | Vehicle reporter for a delivery vehicle that reports location and stop information. An app is allowed only one vehicle reporter. |
210-
| `DeliveryDriverApi.getDeliveryVehicleManager` | Returns a vehicle manager that can be used to fetch the delivery vehicle from Fleet Engine |
211-
| `DeliveryVehicleReporter.setLocationTrackingEnabled(boolean)` | Enable/disabled location tracking(logs). |
212-
| `DeliveryVehicleReporter.setLocationReportingInterval(number)` | Set the log interval(seconds). |
213-
| `DeliveryVehicleReporter.getDriverSdkVersion()` | get delivery driversdk version. | |
214-
| `DeliveryVehicleManager.getDeliveryVehicle()` | Fetch the delivery vehicle from Fleet Engine |
215-
| `DeliveryVehicleReporter.clearInstance()` | clear instance. |
216-
| `DeliveryVehicleReporter.setAbnormalTerminationReporting(boolean)` | enable/disable abnormal termination reporting. |
226+
| Function | Description |
227+
| ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
228+
| `DeliveryDriverApi.initialize` | create the instance of DeliveryDriverAPI. |
229+
| `DeliveryDriverApi.getDeliveryVehicleReporter` | Vehicle reporter for a delivery vehicle that reports location and stop information. An app is allowed only one vehicle reporter. |
230+
| `DeliveryDriverApi.getDeliveryVehicleManager` | Returns a vehicle manager that can be used to fetch the delivery vehicle from Fleet Engine |
231+
| `DeliveryVehicleReporter.setLocationTrackingEnabled(boolean)` | Enable/disabled location tracking(logs). |
232+
| `DeliveryVehicleReporter.setLocationReportingInterval(number)` | Set the log interval(seconds). |
233+
| `DeliveryVehicleReporter.getDriverSdkVersion()` | get delivery driversdk version. | |
234+
| `DeliveryVehicleManager.getDeliveryVehicle()` | Fetch the delivery vehicle from Fleet Engine |
235+
| `DeliveryVehicleReporter.clearInstance()` | clear instance. |
236+
| `DeliveryVehicleReporter.setAbnormalTerminationReporting(boolean)` | enable/disable abnormal termination reporting. |
217237
218238
### Requesting and handling permissions
219239

android/build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
import groovy.json.JsonSlurper
1616

1717
buildscript {
18-
ext.kotlin_version = '2.0.0'
18+
ext.kotlin_version = '2.1.21'
1919
repositories {
2020
google()
2121
mavenCentral()
2222
}
2323

2424
dependencies {
25-
classpath("com.android.tools.build:gradle:8.4.0")
25+
classpath("com.android.tools.build:gradle:8.6.1")
2626
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
2727
}
2828
}
@@ -40,7 +40,7 @@ if (isNewArchitectureEnabled()) {
4040
android {
4141
namespace "com.google.android.react.driversdk"
4242

43-
compileSdkVersion 31
43+
compileSdkVersion 35
4444

4545
compileOptions {
4646
sourceCompatibility JavaVersion.VERSION_1_8
@@ -49,7 +49,7 @@ android {
4949

5050
defaultConfig {
5151
minSdkVersion 23
52-
targetSdkVersion 31
52+
targetSdkVersion 34
5353
versionCode 1
5454
// get version name from package.json version
5555
versionName "1.0"
@@ -85,14 +85,13 @@ repositories {
8585
}
8686

8787
dependencies {
88-
implementation 'com.google.android.libraries.mapsplatform.transportation:transportation-driver:5.99.0'
88+
implementation 'com.google.android.libraries.mapsplatform.transportation:transportation-driver:6.2.0'
8989
implementation 'com.facebook.react:react-native:+'
9090
implementation 'com.android.support:multidex:1.0.3'
9191
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
9292
api 'com.google.guava:guava:31.0.1-android'
93-
implementation 'junit:junit:4.12'
9493

95-
testImplementation 'junit:junit:4.12'
94+
testImplementation 'junit:junit:4.13.2'
9695
testImplementation "com.google.truth:truth:1.1.2"
9796
testImplementation "org.mockito:mockito-core:3.6.0"
9897
testImplementation "org.mockito:mockito-inline:3.6.0"

android/gradle.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

example/LMFS/android/app/build.gradle

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Copyright 2023 Google LLC
2-
//
2+
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
6-
//
6+
//
77
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
8+
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,14 +22,14 @@ apply plugin: 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
2222
*/
2323
react {
2424
/* Folders */
25-
// The root of your project, i.e. where "package.json" lives. Default is '..'
26-
// root = file("../")
27-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
28-
// reactNativeDir = file("../node_modules/react-native")
29-
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
30-
// codegenDir = file("../node_modules/@react-native/codegen")
31-
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
32-
// cliFile = file("../node_modules/react-native/cli.js")
25+
// The root of your project, i.e. where "package.json" lives. Default is '../..'
26+
// root = file("../../")
27+
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
28+
// reactNativeDir = file("../../node_modules/react-native")
29+
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
30+
// codegenDir = file("../../node_modules/@react-native/codegen")
31+
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
32+
// cliFile = file("../../node_modules/react-native/cli.js")
3333

3434
/* Variants */
3535
// The list of variants to that are debuggable. For those we're going to
@@ -63,12 +63,18 @@ react {
6363
//
6464
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
6565
// hermesFlags = ["-O", "-output-source-map"]
66+
67+
/* This example app uses typescript index file, so we need to specify the entry file */
68+
entryFile = file("../../index.ts")
69+
70+
/* Autolinking */
71+
autolinkLibrariesWithApp()
6672
}
6773

6874
/**
6975
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
7076
*/
71-
def enableProguardInReleaseBuilds = false
77+
def enableProguardInReleaseBuilds = true
7278

7379
/**
7480
* The preferred build flavor of JavaScriptCore (JSC)
@@ -116,9 +122,14 @@ android {
116122
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
117123
}
118124
}
125+
compileOptions {
126+
sourceCompatibility JavaVersion.VERSION_17
127+
targetCompatibility JavaVersion.VERSION_17
128+
}
119129
}
120130

121131
dependencies {
132+
implementation 'androidx.appcompat:appcompat:1.1.0'
122133
// The version of react-native is set by the React Native Gradle Plugin
123134
implementation("com.facebook.react:react-android")
124135

@@ -137,12 +148,10 @@ secrets {
137148
// https://developers.google.com/maps/documentation/android-sdk/secrets-gradle-plugin
138149
propertiesFileName = "local.properties"
139150

140-
// For CI/CD, you can have a file with default keys that can be
151+
// For CI/CD, you can have a file with default keys that can be
141152
// safely checked in to your source code version control.
142153
// defaultPropertiesFileName = 'local.defaults.properties'
143154

144155
// Ignore all keys matching the regexp "sdk.*"
145-
ignoreList.add("sdk.*")
156+
ignoreList.add("sdk.*")
146157
}
147-
148-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

example/LMFS/android/app/src/main/java/com/sampleapp/MainApplication.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@
1717
package com.sampleapp;
1818

1919
import android.app.Application;
20+
import androidx.annotation.NonNull;
2021
import com.facebook.react.PackageList;
2122
import com.facebook.react.ReactApplication;
2223
import com.facebook.react.ReactNativeHost;
2324
import com.facebook.react.ReactPackage;
2425
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
2526
import com.facebook.react.defaults.DefaultReactNativeHost;
27+
import com.facebook.react.soloader.OpenSourceMergedSoMapping;
2628
import com.facebook.soloader.SoLoader;
29+
import java.io.IOException;
2730
import java.util.List;
2831

2932
public class MainApplication extends Application implements ReactApplication {
@@ -60,6 +63,7 @@ protected Boolean isHermesEnabled() {
6063
}
6164
};
6265

66+
@NonNull
6367
@Override
6468
public ReactNativeHost getReactNativeHost() {
6569
return mReactNativeHost;
@@ -68,7 +72,11 @@ public ReactNativeHost getReactNativeHost() {
6872
@Override
6973
public void onCreate() {
7074
super.onCreate();
71-
SoLoader.init(this, /* native exopackage */ false);
75+
try {
76+
SoLoader.init(this, OpenSourceMergedSoMapping.INSTANCE);
77+
} catch (IOException e) {
78+
throw new RuntimeException(e);
79+
}
7280
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
7381
// If you opted-in for the New Architecture, we load the native entry point for this app.
7482
DefaultNewArchitectureEntryPoint.load();

example/LMFS/android/build.gradle

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
/**
16+
* Desugaring is required to be set on from navigation-sdk version 6.3.0 onwards.
17+
*/
18+
def enableDesugaring = true
19+
1520
buildscript {
1621
ext {
17-
buildToolsVersion = "34.0.0"
18-
minSdkVersion = 23
19-
compileSdkVersion = 34
22+
buildToolsVersion = "35.0.0"
23+
minSdkVersion = 34
24+
compileSdkVersion = 35
2025
targetSdkVersion = 34
2126
ndkVersion = "26.1.10909125"
2227
}
@@ -25,10 +30,34 @@ buildscript {
2530
mavenCentral()
2631
}
2732
dependencies {
28-
classpath("com.android.tools.build:gradle")
33+
classpath('com.android.tools.build:gradle:8.6.1')
2934
classpath("com.facebook.react:react-native-gradle-plugin")
3035
classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1")
3136
}
3237
}
3338

39+
allprojects {
40+
repositories {
41+
google()
42+
mavenCentral()
43+
}
44+
45+
subprojects {
46+
afterEvaluate { project ->
47+
if (project.hasProperty('android')) {
48+
android {
49+
compileOptions {
50+
coreLibraryDesugaringEnabled enableDesugaring
51+
}
52+
}
53+
54+
dependencies {
55+
// Desugar Java 8+ APIs
56+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.3'
57+
}
58+
}
59+
}
60+
}
61+
}
62+
3463
apply plugin: "com.facebook.react.rootproject"

example/LMFS/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

example/LMFS/android/settings.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
16+
plugins { id("com.facebook.react.settings") }
17+
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
1518
rootProject.name = 'SampleApp'
16-
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
1719
include ':app'
1820
includeBuild('../node_modules/@react-native/gradle-plugin')

example/LMFS/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ end
1010
node_require('react-native/scripts/react_native_pods.rb')
1111
node_require('react-native-permissions/scripts/setup.rb')
1212

13-
platform :ios, "15.0"
13+
platform :ios, "16.0"
1414
prepare_react_native_project!
1515

1616
setup_permissions([

0 commit comments

Comments
 (0)