Following up on @Akshaykumar's solution, I encountered this error: FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction An issue was found when checking AAR metadata:
To resolve this, add the following to your android/app/build.gradle
:
dependencies {
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.0.3"
}
Enable Java 17 and desugaring:
gradleCopyandroid {
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
coreLibraryDesugaringEnabled true
}
}