Skip to content
Open
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
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v22
v22.13.0
102 changes: 102 additions & 0 deletions MIGRATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,112 @@ This document covers breaking changes and migration steps between major versions

## Table of Contents

- [Migrating from 0.16.x to 0.17.x](#migrating-from-016x-to-017x)
- [Migrating from 0.13.x to 0.14.x](#migrating-from-013x-to-014x)

---

## Migrating from 0.16.x to 0.17.x

Version 0.17.0 upgrades the underlying Google Navigation SDKs and raises the minimum Android build toolchain requirements.

### Summary of Breaking Changes

| Category | Change |
| ----------------- | --------------------------------------------------------------------------------------- |
| React Native | Minimum supported React Native version is now `0.87.0` |
| Native SDKs | Android Navigation SDK upgraded to `7.9.0`, iOS Navigation SDK upgraded to `10.15.0` |
| Kotlin | Kotlin Gradle Plugin `2.3.0+` is required; `2.3.21` is the tested version |

### What changed

This release updates the native Navigation SDK dependencies to:

- **Android:** Google Maps Navigation SDK `7.9.0`
- **iOS:** Google Maps Navigation SDK `10.15.0`

There are no JavaScript API changes in this release. React Native `0.87.0` is required and its bundled Android Gradle Plugin (AGP) `9.2.1` is compatible with Navigation SDK `7.9.0`.

### Step 1: Update the Kotlin Gradle Plugin

Navigation SDK requires Kotlin Gradle Plugin `2.3.0+`. React Native `0.87.0` bundles Kotlin `2.2.0`, so Android projects must override it. This SDK is tested with Kotlin Gradle Plugin `2.3.21`.

> [!NOTE]
> Do not override the AGP version when using React Native `0.87.0`; it already supplies a compatible AGP version. Navigation SDK `7.9.0` also fixes the Cronet namespace collision that prevented builds with AGP `9.0.0+`.

#### Configure AGP 9 compatibility

React Native `0.87.0` uses AGP 9. Add these properties to `android/gradle.properties` so AGP uses the overridden Kotlin Gradle Plugin and retains the DSL used by React Native and its libraries:

```properties
android.builtInKotlin=false
android.newDsl=false
```

#### Root `android/build.gradle`

If your app uses a root `build.gradle` with a `buildscript` block, update only the Kotlin entries:

```diff
buildscript {
ext {
- kotlinVersion = "<old version>"
+ kotlinVersion = "2.3.21"
}
dependencies {
- classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.3.21")
}
}
```

#### Plugin DSL

If your project declares plugins in `settings.gradle`, set the Kotlin plugin version there instead:

```groovy
plugins {
id("org.jetbrains.kotlin.android") version "2.3.21" apply false
}
```

### Step 2: Sync and rebuild Android

After updating the Kotlin Gradle Plugin:

```bash
cd android
./gradlew clean
```

Then rebuild your app.

If you run into dependency or build cache issues, reinstall dependencies and rebuild from scratch.

### Step 3: Reinstall iOS pods

The iOS SDK is upgraded to `10.15.0`, so after upgrading the package you should reinstall pods:

```bash
cd ios && pod install
```

### Release notes

For native SDK changes introduced upstream, review the official release notes:

- [Android Navigation SDK 7.9.0 release notes](https://developers.google.com/maps/documentation/navigation/android-sdk/release-notes)
- [iOS Navigation SDK 10.15.0 release notes](https://developers.google.com/maps/documentation/navigation/ios-sdk/release-notes)

### Troubleshooting

If Android builds start failing after upgrading, first verify:

1. Your project uses **React Native 0.87.0+**
2. Your project uses **Kotlin Gradle Plugin 2.3.0+** (`2.3.21` is tested)
3. You have not overridden React Native 0.87's bundled AGP version
4. You have refreshed Gradle dependencies and rebuilt the app

## Migrating from 0.13.x to 0.14.x

Version 0.14.0 introduces React Native's **New Architecture** (Fabric & TurboModules) as a requirement, dropping support for the legacy architecture. This release also includes breaking API changes and new features.
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ This repository contains a React Native plugin that provides a [Google Navigatio

## React Native Compatibility

The current version of this package has been tested and verified to work with the following React Native versions:

**0.83.1, 0.82.1, 0.81.5, 0.80.3, 0.79.6**
The current version of this package has been tested and verified with **React Native 0.87.0**.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we tell that to use older versions of the RN 0.79.6-0.86.0 use the package version


> [!IMPORTANT]
> This package requires React Native 0.79+ with the new architecture (Fabric & TurboModules) enabled. Make sure the new architecture is enabled in your project configuration as shown in the [Installation](#installation) section.
> This package requires React Native 0.87+ with the new architecture (Fabric & TurboModules) enabled. Make sure the new architecture is enabled in your project configuration as shown in the [Installation](#installation) section.

> [!NOTE]
> React Native 0.78.x and below are not supported due to Kotlin version incompatibility. If you need to use older React Native versions, please use version 0.13.x of this package with the old architecture.
> Navigation SDK requires Kotlin Gradle Plugin 2.3.0+. React Native 0.87 bundles Kotlin 2.2.0, so override it with Kotlin Gradle Plugin 2.3.21 as described in the [Migration Guide](./MIGRATING.md).

> [!NOTE]
> For users upgrading from versions prior to 0.14.0, please refer to the [Migration Guide](./MIGRATING.md) for instructions on migrating to the new architecture and updated API.
Expand Down Expand Up @@ -93,7 +91,7 @@ android {
}

dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.4'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.1.5'
}
```

Expand Down
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ android {
buildConfig true
}

lintOptions {
lint {
abortOnError false
disable "GradleCompatible"
disable += "GradleCompatible"
}

sourceSets {
Expand All @@ -59,6 +59,6 @@ dependencies {
implementation "androidx.car.app:app:1.4.0"
implementation "androidx.car.app:app-projected:1.4.0"
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "com.google.android.libraries.navigation:navigation:7.6.1"
implementation "com.google.android.libraries.navigation:navigation:7.9.0"
api 'com.google.guava:guava:31.0.1-android'
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.google.android.gms.maps.GoogleMap.CameraPerspective;
import com.google.android.gms.maps.model.MapColorScheme;
import com.google.android.libraries.navigation.AlternateRoutesStrategy;
import com.google.android.libraries.navigation.AudioGuidanceSettings;
import com.google.android.libraries.navigation.ForceNightMode;
import com.google.android.libraries.navigation.Navigator;
import com.google.android.libraries.navigation.RoutingOptions;
Expand All @@ -33,16 +34,12 @@ public static AlternateRoutesStrategy getAlternateRoutesStrategyFromJsValue(int
}
}

public static @Navigator.AudioGuidance int getAudioGuidanceFromJsValue(int jsValue) {
switch (jsValue) {
case 0:
return Navigator.AudioGuidance.SILENT;
case 1:
return Navigator.AudioGuidance.VOICE_ALERTS_ONLY;
case 2:
default:
return Navigator.AudioGuidance.VOICE_ALERTS_AND_GUIDANCE;
}
public static AudioGuidanceSettings.GuidanceMode getAudioGuidanceModeFromJsValue(int jsValue) {
return switch (jsValue) {
case 0 -> AudioGuidanceSettings.GuidanceMode.SILENT;
case 1 -> AudioGuidanceSettings.GuidanceMode.VOICE_ALERTS_ONLY;
default -> AudioGuidanceSettings.GuidanceMode.VOICE_ALERTS_AND_GUIDANCE;
};
}

public static @Navigator.TaskRemovedBehavior int getTaskRemovedBehaviourFromJsValue(int jsValue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.google.android.libraries.mapsplatform.turnbyturn.model.NavInfo;
import com.google.android.libraries.mapsplatform.turnbyturn.model.StepInfo;
import com.google.android.libraries.navigation.ArrivalEvent;
import com.google.android.libraries.navigation.AudioGuidanceSettings;
import com.google.android.libraries.navigation.CustomRoutesOptions;
import com.google.android.libraries.navigation.DisplayOptions;
import com.google.android.libraries.navigation.ListenableResultFuture;
Expand Down Expand Up @@ -821,7 +822,10 @@ public void setAudioGuidanceType(double index, final Promise promise) {

UiThreadUtil.runOnUiThread(
() -> {
mNavigator.setAudioGuidance(EnumTranslationUtil.getAudioGuidanceFromJsValue(jsValue));
mNavigator.setAudioGuidanceSettings(
AudioGuidanceSettings.builder()
.setGuidanceMode(EnumTranslationUtil.getAudioGuidanceModeFromJsValue(jsValue))
.build());
});
promise.resolve(null);
}
Expand Down
22 changes: 7 additions & 15 deletions example/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,12 @@ GEM
base64
nkf
rexml
activesupport (7.2.2.2)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
activesupport (6.1.7.10)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
algoliasearch (1.27.5)
Expand Down Expand Up @@ -66,8 +60,6 @@ GEM
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.3.3)
connection_pool (2.5.3)
drb (2.2.3)
escape (0.0.4)
ethon (0.15.0)
ffi (>= 1.15.0)
Expand All @@ -79,9 +71,9 @@ GEM
mutex_m
i18n (1.14.7)
concurrent-ruby (~> 1.0)
json (2.13.2)
json (2.7.6)
logger (1.7.0)
minitest (5.25.5)
minitest (5.25.4)
molinillo (0.8.0)
mutex_m (0.3.0)
nanaimo (0.3.0)
Expand All @@ -91,7 +83,6 @@ GEM
public_suffix (4.0.7)
rexml (3.4.2)
ruby-macho (2.5.1)
securerandom (0.4.1)
typhoeus (1.5.0)
ethon (>= 0.9.0, < 0.16.0)
tzinfo (2.0.6)
Expand All @@ -103,6 +94,7 @@ GEM
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (>= 3.3.6, < 4.0)
zeitwerk (2.6.18)

PLATFORMS
ruby
Expand Down
4 changes: 2 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ android {
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro", "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro"
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro", "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro"
}
}
compileOptions {
Expand All @@ -153,7 +153,7 @@ dependencies {
implementation "androidx.car.app:app-projected:1.4.0"

// Include the Google Navigation SDK.
implementation 'com.google.android.libraries.navigation:navigation:7.6.1'
implementation 'com.google.android.libraries.navigation:navigation:7.9.0'
}

secrets {
Expand Down
12 changes: 6 additions & 6 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ def enableDesugaring = true

buildscript {
ext {
buildToolsVersion = "36.0.0"
buildToolsVersion = "37.0.0"
minSdkVersion = 34
compileSdkVersion = 36
compileSdkVersion = 37
targetSdkVersion = 36
ndkVersion = "27.1.12297006"
kotlinVersion = "2.0.21"
kotlinVersion = "2.3.21"
}
repositories {
google()
Expand All @@ -35,7 +35,7 @@ buildscript {
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.3.21")
classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1")
classpath('com.ncorti.ktfmt.gradle:plugin:0.21.0')
}
Expand All @@ -57,7 +57,7 @@ allprojects {
exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
}

subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
Expand All @@ -69,7 +69,7 @@ allprojects {

dependencies {
// Desugar Java 8+ APIs (NIO flavor required for Navigation SDK 7.5.0+)
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.4'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.1.5'
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@ hermesEnabled=true
# This allows your app to draw behind system bars for an immersive UI.
# Note: Only works with ReactActivity and should not be used with custom Activity.
edgeToEdgeEnabled=false

# RN 0.87 uses AGP 9, whose built-in Kotlin and new DSL behavior must remain
# disabled while this app overrides Kotlin to satisfy the Navigation SDK.
android.builtInKotlin=false
android.newDsl=false
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 12 additions & 2 deletions example/ios/SampleApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -818,15 +818,20 @@
);
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "$(inherited)";
OTHER_CFLAGS = (
"$(inherited)",
"-DRCT_REMOVE_LEGACY_ARCH=1",
);
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DFOLLY_NO_CONFIG",
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
"-DRCT_REMOVE_LEGACY_ARCH=1",
);
PODFILE_DIR = "$(SRCROOT)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
Expand Down Expand Up @@ -887,15 +892,20 @@
"\"$(inherited)\"",
);
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = "$(inherited)";
OTHER_CFLAGS = (
"$(inherited)",
"-DRCT_REMOVE_LEGACY_ARCH=1",
);
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DFOLLY_NO_CONFIG",
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
"-DRCT_REMOVE_LEGACY_ARCH=1",
);
PODFILE_DIR = "$(SRCROOT)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
Expand Down
Loading
Loading