Skip to content

Commit 32fcc95

Browse files
authored
docs: update README.md with desugaring instructions and known issues (#223)
* docs: add desugaring info to the README.md file * docs: add known issues to README.md
1 parent 2efd1d7 commit 32fcc95

File tree

1 file changed

+48
-23
lines changed

1 file changed

+48
-23
lines changed

README.md

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ This repository contains a Flutter plugin that provides a [Google Navigation](ht
99
1010
## Requirements
1111

12-
| | Android | iOS |
13-
| ------------------------------- | ------- | --------- |
12+
| | Android | iOS |
13+
| ------------------------------- | ------------- | --------- |
1414
| **Minimum mobile OS supported** | API level 23+ | iOS 15.0+ |
1515

1616
* A Flutter project
@@ -27,36 +27,52 @@ This repository contains a Flutter plugin that provides a [Google Navigation](ht
2727
2828
## Installation
2929

30-
1. To add the Google Navigation for Flutter package to your project, use the command:
31-
```
32-
flutter pub add google_navigation_flutter
33-
```
30+
To add the Google Navigation for Flutter package to your project, use the command:
31+
```
32+
flutter pub add google_navigation_flutter
33+
```
3434

35-
2. Set the minimum platform version for the platform(s) targeted by your app.
35+
### Android
3636

37-
### Android
37+
Set the `minSdkVersion` in `android/app/build.gradle`:
3838

39-
Set the `minSdkVersion` in `android/app/build.gradle`:
39+
```groovy
40+
android {
41+
defaultConfig {
42+
minSdkVersion 23
43+
}
44+
}
45+
```
4046

41-
```groovy
42-
android {
43-
defaultConfig {
44-
minSdkVersion 23
45-
}
47+
If `minSdkVersion` is set to less than 34 (API 34), you need to configure desugaring for your Android app.
48+
To enable desugaring, add the following configurations to `android/app/build.gradle` file:
49+
```groovy
50+
android {
51+
...
52+
compileOptions {
53+
coreLibraryDesugaringEnabled true
54+
...
4655
}
47-
```
56+
}
4857
49-
### iOS
58+
dependencies {
59+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.4'
60+
}
61+
```
5062

51-
1. Open the ios/Podfile config file in your preferred IDE.
52-
1. Add the following lines to the beginning of this Podfile:
63+
### iOS
5364

54-
```
55-
# Set platform to 15.0 to enable latest Google Maps SDK
56-
platform :ios, '15.0'
57-
```
65+
1. Open the ios/Podfile config file in your preferred IDE.
66+
2. Add the following lines to the beginning of this Podfile:
5867

59-
3. Add your API key to the Flutter project using [these instructions for the corresponding Android (build.gradle) and iOS (AppDelegate.swift) files](https://developers.google.com/maps/flutter-package/config#step_4_add_your_api_key_to_the_project). The instructions for this step in the google_maps_flutter package documentation apply to the google_navigation_flutter package as well.
68+
```
69+
# Set platform to 15.0 to enable latest Google Maps SDK
70+
platform :ios, '15.0'
71+
```
72+
73+
### Set Google Maps API Key
74+
75+
Add your API key to the Flutter project using [these instructions for the corresponding Android (build.gradle) and iOS (AppDelegate.swift) files](https://developers.google.com/maps/flutter-package/config#step_4_add_your_api_key_to_the_project). The instructions for this step in the google_maps_flutter package documentation apply to the google_navigation_flutter package as well.
6076

6177
See the example configuration for Secrets Gradle Plugin in the example app's [build.gradle](./example/android/app/build.gradle) file.
6278
To securely load your API key, use the [Secrets Gradle Plugin](https://developers.google.com/maps/documentation/android-sdk/secrets-gradle-plugin). This plugin helps manage API keys without exposing them in your app's source code.
@@ -201,6 +217,15 @@ Widget build(BuildContext context) {
201217
}
202218
```
203219

220+
## Known issues
221+
222+
### Compatibility with other libraries
223+
224+
This package uses the Google Maps [Navigation SDK](https://mapsplatform.google.com/maps-products/navigation-sdk/) for Android and iOS, which includes a dependency on the `Google Maps SDK`. If your project includes other flutter libraries with `Google Maps SDK` dependencies, you may encounter build errors due to version conflicts. To avoid this, it's recommended to avoid using multiple packages with Google Maps dependencies.
225+
226+
> [!NOTE]
227+
> This package provides a `GoogleMapsMapView` widget, which can be used as a classic Google Maps view without navigation. See [Add a map view](#add-a-map-view) for details.
228+
204229
## Contributing
205230

206231
See the [Contributing guide](https://github.com/googlemaps/flutter-navigation-sdk/blob/main/CONTRIBUTING.md).

0 commit comments

Comments
 (0)