Skip to content

Commit f0b4d07

Browse files
committed
fix(auth, android): add browser dependency as crash workaround
The reCAPTCHA auth flow requires androidx.browser but it is not specified as a transitive dependency upstream, so it crashes. I attempted to use as wide a version range as I felt safe, and provided an override if you specify "androidxBrowserVersion" in your android/build.gradle ext config block Related #4744 Related firebase/firebase-android-sdk#2164 This may be removed when the upstream issue is closed.
1 parent d17b382 commit f0b4d07

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/auth/android/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,21 @@ repositories {
8181
jcenter()
8282
}
8383

84+
def safeExtGet(prop, fallback) {
85+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
86+
}
87+
88+
def BROWSER_VERSION = safeExtGet('androidxBrowserVersion', '[1.0.0, 2.0.0)')
89+
8490
dependencies {
8591
api appProject
8692
implementation platform("com.google.firebase:firebase-bom:${ReactNative.ext.getVersion("firebase", "bom")}")
8793
implementation "com.google.firebase:firebase-auth"
94+
95+
// This is needed for the reCAPTCHA flow but is incorrectly missing as a transitive dependency upstream
96+
// https://github.com/invertase/react-native-firebase/issues/4744
97+
// https://github.com/firebase/firebase-android-sdk/issues/2164
98+
implementation "androidx.browser:browser:${BROWSER_VERSION}"
8899
}
89100

90101
ReactNative.shared.applyPackageVersion()

0 commit comments

Comments
 (0)