# Java Desugaring

Some libraries (e.g. Google Play Services) may require core library desugaring to support certain Java 8+ APIs. If your build fails with an error indicating that desugaring is required, please follow the instructions below to enable it.&#x20;

### 1. Add compileOptions

Locate and open the file at `android/app/build.gradle` .

Then, inside the `android` block, add the `compileOptions` section:

```gradle
android {
    compileOptions {
        coreLibraryDesugaringEnabled true
    }
}
```

### 2. Add Desugaring dependency

Inside the `dependencies` block of the same `android/app/build.gradle` file, add:

```gradle
dependencies {
  coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
}
```

Please check [Maven Central](https://mvnrepository.com/artifact/com.android.tools/desugar_jdk_libs) for the latest version of `desugar_jdk_libs`.

### 3. Build the project

Now you can build your project. Desugaring will be applied during the Gradle build.
