This page offers tips and troubleshooting for Android-specific issues that you might encounter when using Firebase.
Have other challenges or don't see your issue outlined below? Make sure to check out the main Firebase FAQ for more pan-Firebase or product-specific FAQ.
You can also check out the Firebase Android SDK GitHub repo for an up-to-date list of reported issues and troubleshooting. We encourage you to file your own Firebase Android SDK related issues there, too!
In May 2021 (Firebase BoM v28.0.0), Firebase disabled desugaring for all its Android libraries (see release note).
This change means that Gradle builds that use Android Gradle plugin (AGP) v4.2 or earlier need to enable Java 8 support. Otherwise, when adding a Firebase SDK, these Android projects get the following build failure:
D8: Invoke-customs are only supported starting with Android O (--min-api 26) Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing. The dependency contains Java 8 bytecode. Please enable desugaring by adding the following to build.gradle android { compileOptions { sourceCompatibility 1.8 targetCompatibility 1.8 } } See https://developer.android.com/studio/write/java8-support.html for details. Alternatively, increase the minSdkVersion to 26 or above.
To fix this build failure, you can follow one of two options:
- Add the listed
compileOptions
from the error message to your app-levelbuild.gradle
file. - Increase the
minSdkVersion
for your Android project to 26 or above.