Skip to content

fix(flutter): add android extra step installing DataStore lib #5148

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

Merged
merged 2 commits into from
Feb 24, 2023
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 cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@
"javax",
"jcenter",
"jdoe",
"jetbrains",
"jobTitle",
"jpg",
"js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,28 @@ dependencies:
amplify_flutter: ^0.6.0
amplify_datastore: ^0.6.0
```

### Update The Android Project

Open `build.gradle` located under `android/app`, and enable `coreLibraryDesugaringEnabled` in `compileOptions` to support the Java8 feature used in the DataStore plugin.

```groovy
compileOptions {
// add this line to support Java8 features
coreLibraryDesugaringEnabled true

sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
```

Add the following dependency in `dependencies`.

```groovy
dependencies {
// add this line to support Java8 features
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
```