# Fixing the AndroidX Build Error After Adding Firebase to Unity

Enable AndroidX and Jetifier through Unity’s custom Gradle properties template to resolve a Firebase build failure.

After importing Firebase into Unity, I encountered the following build error:

```
Could not determine the dependencies of task ':launcher:lintVitalRelease'.
> This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
  The following AndroidX dependencies are detected: androidx.fragment:fragment:1.0.0, androidx.slidingpanelayout:slidingpanelayout:1.0.0,
```

The project depended on AndroidX, but `android.useAndroidX` had not been enabled.

## Enable the Gradle properties template

Under **Build Settings → Player → Publishing Settings**, enable **Custom Gradle Properties Template**. Unity generates the template at `Assets/Plugins/Android/gradleTemplate.properties`.

Add these two lines:

```
android.useAndroidX=true
android.enableJetifier=true
```

My resulting properties file looked like this:

```
org.gradle.jvmargs=-Xmx**JVM_HEAP_SIZE**M
org.gradle.parallel=true
android.enableR8=**MINIFY_WITH_R_EIGHT**
unityStreamingAssets=**STREAMING_ASSETS**
android.useAndroidX=true
android.enableJetifier=true
**ADDITIONAL_PROPERTIES**
```

That resolved the problem in this project.