Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SignInWithPhoneNumber fails on emulator due to missing browser dependency #2164

Closed
jeremycod opened this issue Nov 9, 2020 · 34 comments
Closed
Assignees

Comments

@jeremycod
Copy link

jeremycod commented Nov 9, 2020

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in the code in this repository.
If you have a general question, need help debugging, or fall into some
other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 4.1
  • Firebase Component: _____ (Database, Firestore, Storage, Functions, etc)
    "@react-native-firebase/app": "^8.4.7",
    "@react-native-firebase/auth": "^9.3.2",
  • Component version: _____

[REQUIRED] Step 3: Describe the problem

I know this is not place to report react-native-firebase, but it seems that the problem is cause by the bug in firebase-android-sdk and could be easily fixed.

Steps to reproduce:

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

Relevant Code:

firebase
                    .auth()
                    .signInWithPhoneNumber(phone)

This code caused app to crash in Android emulator with the following exception:

11-09 10:36:31.681   303  8778 W android.hardware.audio.service.ranchu: TinyalsaSink::write:125 pcm_write was late reading frames, dropping 22131 us of audio
11-09 10:36:31.703   303  8778 W android.hardware.audio.service.ranchu: TinyalsaSink::write:125 pcm_write was late reading frames, dropping 22131 us of audio
11-09 10:36:31.704 26370 26370 D AndroidRuntime: Shutting down VM
11-09 10:36:31.705 26370 26370 E AndroidRuntime: FATAL EXCEPTION: main
11-09 10:36:31.705 26370 26370 E AndroidRuntime: Process: com.fillrxapp, PID: 26370
11-09 10:36:31.705 26370 26370 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/browser/customtabs/CustomTabsIntent$Builder;
11-09 10:36:31.705 26370 26370 E AndroidRuntime: 	at com.google.firebase.auth.internal.RecaptchaActivity.zza(com.google.firebase:firebase-auth@@20.0.0:92)
11-09 10:36:31.705 26370 26370 E AndroidRuntime: 	at com.google.firebase.auth.api.internal.zzeq.zza(com.google.firebase:firebase-auth@@20.0.0:79)
11-09 10:36:31.705 26370 26370 E AndroidRuntime: 	at com.google.firebase.auth.api.internal.zzeq.onPostExecute(com.google.firebase:firebase-auth@@20.0.0:88)
11-09 10:36:31.705 26370 26370 E AndroidRuntime: 	at android.os.AsyncTask.finish(AsyncTask.java:771)
11-09 10:36:31.705 26370 26370 E AndroidRuntime: 	at android.os.AsyncTask.access$900(AsyncTask.java:199)
11-09 10:36:31.705 26370 26370 E AndroidRuntime: 	at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)
11-09 10:36:31.705 26370 26370 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
11-09 10:36:31.705 26370 26370 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:223)
11-09 10:36:31.705 26370 26370 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7656)
11-09 10:36:31.705 26370 26370 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
11-09 10:36:31.705 26370 26370 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
11-09 10:36:31.705 26370 26370 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
11-09 10:36:31.705 26370 26370 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.browser.customtabs.CustomTabsIntent$Builder" on path: DexPathList[[zip file "/data/app/~~6eWSD3gCIvYqPb-GrDJ-Kg==/com.fillrxapp-gbh8cuZ6n2cKCKIKV-hi1g==/base.apk"],nativeLibraryDirectories=[/data/app/~~6eWSD3gCIvYqPb-GrDJ-Kg==/com.fillrxapp-gbh8cuZ6n2cKCKIKV-hi1g==/lib/x86, /data/app/~~6eWSD3gCIvYqPb-GrDJ-Kg==/com.fillrxapp-gbh8cuZ6n2cKCKIKV-hi1g==/base.apk!/lib/x86, /system/lib, /system_ext/lib]]
11-09 10:36:31.705 26370 26370 E AndroidRuntime: 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
11-09 10:36:31.705 26370 26370 E AndroidRuntime: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
11-09 10:36:31.705 26370 26370 E AndroidRuntime: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
11-09 10:36:31.705 26370 26370 E AndroidRuntime: 	... 12 more
11-09 10:36:31.710   520 26549 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
11-09 10:36:31.710   520  1833 W ActivityTaskManager:   Force finishing activity com.fillrxapp/com.google.firebase.auth.internal.RecaptchaActivity
11-09 10:36:31.712   317  1866 D goldfish-address-space: allocate: Ask for block of size 0x5da800

It seems that auth in this case doesn't add browser which is used for reCAPTCH verification and thus it's causing crash on Android.

Adding

implementation "androidx.browser:browser:1.2.0"

to app/build.gradle solved the issue.

Relevant discussion could be found here invertase/react-native-firebase#4490

@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@mikehardy
Copy link

Just saw this, thanks for logging it upstream @jeremycod - my best analysis from the linked issue is that this is just a missing dependency in the firebase-android-sdk auth package's gradle as noted here. Happy to adjust what @react-native-firebase/auth does downstream if my diagnosis was incorrect

@malcolmdeck
Copy link
Contributor

Yeah, there was a problem in the 20.0.0 release that required the addition of that dependency. I think I fixed it in 20.0.1 (which is BoM version 26.1.0), but please reopen this if it's still popping up for you after switch dep versions

@mikehardy
Copy link

Yep - looks like they fixed it, I noted that in the release notes too but forgot to bring that info back here :-)

@k-zen
Copy link

k-zen commented Nov 26, 2020

This problem occurs in 26.1.0 too.

@malcolmdeck
Copy link
Contributor

Hey @k-zen , thanks for the report. Can you please share the build.gradle of a minimal reproduction of the issue so I can try to make this happen on my end?

@k-zen
Copy link

k-zen commented Dec 1, 2020

This is my app/build.gradle file. The bug occurs in a Nokia 3.1 Plus running Android 10, plus the latest Flutter version.

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 29

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        applicationId "..."
        minSdkVersion 18
        targetSdkVersion 29
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    buildTypes {
        release {
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation platform('com.google.firebase:firebase-bom:26.1.0')
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-auth'
    // implementation "androidx.browser:browser:1.2.0"
}

This is the stack trace:

E/AndroidRuntime( 8224): java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/browser/customtabs/CustomTabsIntent$Builder;
E/AndroidRuntime( 8224): 	at com.google.firebase.auth.internal.RecaptchaActivity.zza(com.google.firebase:firebase-auth@@20.0.1:13)
E/AndroidRuntime( 8224): 	at com.google.android.gms.internal.firebase-auth-api.zzth.zzb(com.google.firebase:firebase-auth@@20.0.1:7)
E/AndroidRuntime( 8224): 	at com.google.android.gms.internal.firebase-auth-api.zzth.onPostExecute(Unknown Source:2)
E/AndroidRuntime( 8224): 	at android.os.AsyncTask.finish(AsyncTask.java:755)
E/AndroidRuntime( 8224): 	at android.os.AsyncTask.access$900(AsyncTask.java:192)
E/AndroidRuntime( 8224): 	at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:772)
E/AndroidRuntime( 8224): 	at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime( 8224): 	at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime( 8224): 	at android.app.ActivityThread.main(ActivityThread.java:7386)
E/AndroidRuntime( 8224): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 8224): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime( 8224): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)

And indeed the problem goes away by adding the dependency: implementation "androidx.browser:browser:1.2.0"

@mikehardy
Copy link

Out of curiosity @k-zen - how are you getting the latest BoM 26.1.0 to work with Flutter? Are you using FlutterFire?

I ask because I wasn't aware v26 was possible for FlutterFire yet, and I'm the person working on it 😅 firebase/flutterfire#4249 (that PR is in progress)

I'd be interested what ./gradlew dependencies (or maybe ./gradlew :app:dependencies (sometimes the ':app:' is important) says with regard to what is actually being resolved for you as far as versions

@k-zen
Copy link

k-zen commented Dec 1, 2020

Yes, I am using FlutterFire. I will attach my YAML file:

name: ...
description: A new Flutter project.
publish_to: 'none'
version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: any
  rxdart: any
  path_provider: any
  image_picker: any
  pedantic: any
  http: any
  json_annotation: any
  build_runner: any
  json_serializable: any
  flutter_secure_storage: any
  shared_preferences: any
  google_fonts: any
  firebase_core: any
  firebase_auth: any

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true
  ...

This is the output of ./gradlew :app:dependencies for debugRuntimeClasspath:

+--- io.flutter:flutter_embedding_debug:1.0.0-2c956a31c0a3d350827aee6c56bb63337c5b4e6e
|    +--- androidx.lifecycle:lifecycle-common:2.2.0
|    |    \--- androidx.annotation:annotation:1.1.0
|    +--- androidx.lifecycle:lifecycle-common-java8:2.2.0
|    |    +--- androidx.lifecycle:lifecycle-common:2.2.0 (*)
|    |    \--- androidx.annotation:annotation:1.1.0
|    +--- androidx.lifecycle:lifecycle-runtime:2.2.0
|    |    +--- androidx.lifecycle:lifecycle-common:2.2.0 (*)
|    |    +--- androidx.arch.core:core-common:2.1.0
|    |    |    \--- androidx.annotation:annotation:1.1.0
|    |    \--- androidx.annotation:annotation:1.1.0
|    +--- androidx.fragment:fragment:1.1.0
|    |    +--- androidx.annotation:annotation:1.1.0
|    |    +--- androidx.core:core:1.1.0
|    |    |    +--- androidx.annotation:annotation:1.1.0
|    |    |    +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.2.0 (*)
|    |    |    +--- androidx.versionedparcelable:versionedparcelable:1.1.0
|    |    |    |    +--- androidx.annotation:annotation:1.1.0
|    |    |    |    \--- androidx.collection:collection:1.0.0 -> 1.1.0
|    |    |    |         \--- androidx.annotation:annotation:1.1.0
|    |    |    \--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
|    |    +--- androidx.collection:collection:1.1.0 (*)
|    |    +--- androidx.viewpager:viewpager:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
|    |    |    \--- androidx.customview:customview:1.0.0
|    |    |         +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |         \--- androidx.core:core:1.0.0 -> 1.1.0 (*)
|    |    +--- androidx.loader:loader:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
|    |    |    +--- androidx.lifecycle:lifecycle-livedata:2.0.0
|    |    |    |    +--- androidx.arch.core:core-runtime:2.0.0
|    |    |    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    |    |    \--- androidx.arch.core:core-common:2.0.0 -> 2.1.0 (*)
|    |    |    |    +--- androidx.lifecycle:lifecycle-livedata-core:2.0.0
|    |    |    |    |    +--- androidx.lifecycle:lifecycle-common:2.0.0 -> 2.2.0 (*)
|    |    |    |    |    +--- androidx.arch.core:core-common:2.0.0 -> 2.1.0 (*)
|    |    |    |    |    \--- androidx.arch.core:core-runtime:2.0.0 (*)
|    |    |    |    \--- androidx.arch.core:core-common:2.0.0 -> 2.1.0 (*)
|    |    |    \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0 -> 2.1.0
|    |    |         \--- androidx.annotation:annotation:1.1.0
|    |    +--- androidx.activity:activity:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.1.0
|    |    |    +--- androidx.core:core:1.1.0 (*)
|    |    |    +--- androidx.lifecycle:lifecycle-runtime:2.1.0 -> 2.2.0 (*)
|    |    |    +--- androidx.lifecycle:lifecycle-viewmodel:2.1.0 (*)
|    |    |    \--- androidx.savedstate:savedstate:1.0.0
|    |    |         +--- androidx.annotation:annotation:1.1.0
|    |    |         +--- androidx.arch.core:core-common:2.0.1 -> 2.1.0 (*)
|    |    |         \--- androidx.lifecycle:lifecycle-common:2.0.0 -> 2.2.0 (*)
|    |    \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0 -> 2.1.0 (*)
|    \--- androidx.annotation:annotation:1.1.0
+--- io.flutter:armeabi_v7a_debug:1.0.0-2c956a31c0a3d350827aee6c56bb63337c5b4e6e
+--- io.flutter:arm64_v8a_debug:1.0.0-2c956a31c0a3d350827aee6c56bb63337c5b4e6e
+--- io.flutter:x86_64_debug:1.0.0-2c956a31c0a3d350827aee6c56bb63337c5b4e6e
+--- io.flutter:x86_debug:1.0.0-2c956a31c0a3d350827aee6c56bb63337c5b4e6e
+--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.50
|    \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50
|         +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.50
|         \--- org.jetbrains:annotations:13.0
+--- com.google.firebase:firebase-bom:26.1.0
|    +--- com.google.firebase:firebase-analytics:18.0.0 (c)
|    +--- com.google.firebase:firebase-auth:20.0.1 (c)
|    +--- com.google.firebase:firebase-core:18.0.0 (c)
|    +--- com.google.firebase:firebase-common:19.4.0 (c)
|    \--- com.google.firebase:firebase-installations:16.3.4 (c)
+--- com.google.firebase:firebase-analytics -> 18.0.0
|    +--- com.google.android.gms:play-services-measurement:18.0.0
|    |    +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
|    |    +--- androidx.legacy:legacy-support-core-utils:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
|    |    |    +--- androidx.documentfile:documentfile:1.0.0
|    |    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    +--- androidx.loader:loader:1.0.0 (*)
|    |    |    +--- androidx.localbroadcastmanager:localbroadcastmanager:1.0.0
|    |    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    \--- androidx.print:print:1.0.0
|    |    |         \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    +--- com.google.android.gms:play-services-ads-identifier:17.0.0
|    |    |    \--- com.google.android.gms:play-services-basement:17.0.0 -> 17.1.0
|    |    |         +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
|    |    |         +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
|    |    |         \--- androidx.fragment:fragment:1.0.0 -> 1.1.0 (*)
|    |    +--- com.google.android.gms:play-services-basement:17.0.0 -> 17.1.0 (*)
|    |    +--- com.google.android.gms:play-services-measurement-base:18.0.0
|    |    |    \--- com.google.android.gms:play-services-basement:17.0.0 -> 17.1.0 (*)
|    |    +--- com.google.android.gms:play-services-measurement-impl:18.0.0
|    |    |    +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
|    |    |    +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
|    |    |    +--- com.google.android.gms:play-services-ads-identifier:17.0.0 (*)
|    |    |    +--- com.google.android.gms:play-services-basement:17.0.0 -> 17.1.0 (*)
|    |    |    +--- com.google.android.gms:play-services-measurement-base:18.0.0 (*)
|    |    |    \--- com.google.android.gms:play-services-stats:17.0.0
|    |    |         +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
|    |    |         \--- com.google.android.gms:play-services-basement:17.0.0 -> 17.1.0 (*)
|    |    \--- com.google.android.gms:play-services-stats:17.0.0 (*)
|    +--- com.google.android.gms:play-services-measurement-api:18.0.0
|    |    +--- com.google.android.gms:play-services-ads-identifier:17.0.0 (*)
|    |    +--- com.google.android.gms:play-services-basement:17.0.0 -> 17.1.0 (*)
|    |    +--- com.google.android.gms:play-services-measurement-base:18.0.0 (*)
|    |    +--- com.google.android.gms:play-services-measurement-sdk-api:18.0.0
|    |    |    +--- com.google.android.gms:play-services-basement:17.0.0 -> 17.1.0 (*)
|    |    |    \--- com.google.android.gms:play-services-measurement-base:18.0.0 (*)
|    |    +--- com.google.android.gms:play-services-tasks:17.0.0
|    |    |    \--- com.google.android.gms:play-services-basement:17.0.0 -> 17.1.0 (*)
|    |    +--- com.google.firebase:firebase-common:19.3.0 -> 19.4.0
|    |    |    +--- com.google.android.gms:play-services-basement:17.0.0 -> 17.1.0 (*)
|    |    |    +--- com.google.android.gms:play-services-tasks:17.0.0 (*)
|    |    |    \--- com.google.firebase:firebase-components:16.0.1
|    |    |         \--- androidx.annotation:annotation:1.1.0
|    |    +--- com.google.firebase:firebase-components:16.0.0 -> 16.0.1 (*)
|    |    +--- com.google.firebase:firebase-installations:16.3.2 -> 16.3.4
|    |    |    +--- com.google.android.gms:play-services-tasks:17.0.0 (*)
|    |    |    +--- com.google.firebase:firebase-common:19.4.0 (*)
|    |    |    +--- com.google.firebase:firebase-components:16.0.0 -> 16.0.1 (*)
|    |    |    \--- com.google.firebase:firebase-installations-interop:16.0.0
|    |    |         \--- com.google.android.gms:play-services-tasks:17.0.0 (*)
|    |    +--- com.google.firebase:firebase-installations-interop:16.0.0 (*)
|    |    \--- com.google.firebase:firebase-measurement-connector:18.0.0
|    |         \--- com.google.android.gms:play-services-basement:17.0.0 -> 17.1.0 (*)
|    \--- com.google.android.gms:play-services-measurement-sdk:18.0.0
|         +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
|         +--- com.google.android.gms:play-services-basement:17.0.0 -> 17.1.0 (*)
|         +--- com.google.android.gms:play-services-measurement-base:18.0.0 (*)
|         \--- com.google.android.gms:play-services-measurement-impl:18.0.0 (*)
+--- com.google.firebase:firebase-auth -> 20.0.1
|    +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
|    +--- androidx.fragment:fragment:1.0.0 -> 1.1.0 (*)
|    +--- androidx.localbroadcastmanager:localbroadcastmanager:1.0.0 (*)
|    +--- com.google.android.gms:play-services-auth-api-phone:17.4.0
|    |    +--- com.google.android.gms:play-services-base:17.1.0
|    |    |    +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
|    |    |    +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
|    |    |    +--- androidx.fragment:fragment:1.0.0 -> 1.1.0 (*)
|    |    |    +--- com.google.android.gms:play-services-basement:17.0.0 -> 17.1.0 (*)
|    |    |    \--- com.google.android.gms:play-services-tasks:17.0.0 (*)
|    |    +--- com.google.android.gms:play-services-basement:17.1.0 (*)
|    |    \--- com.google.android.gms:play-services-tasks:17.0.0 (*)
|    +--- com.google.android.gms:play-services-base:17.1.0 (*)
|    +--- com.google.android.gms:play-services-basement:17.0.0 -> 17.1.0 (*)
|    +--- com.google.android.gms:play-services-safetynet:17.0.0
|    |    +--- com.google.android.gms:play-services-base:17.0.0 -> 17.1.0 (*)
|    |    +--- com.google.android.gms:play-services-basement:17.0.0 -> 17.1.0 (*)
|    |    \--- com.google.android.gms:play-services-tasks:17.0.0 (*)
|    +--- com.google.android.gms:play-services-tasks:17.0.0 (*)
|    +--- com.google.firebase:firebase-auth-interop:19.0.0
|    |    +--- com.google.android.gms:play-services-base:17.0.0 -> 17.1.0 (*)
|    |    +--- com.google.android.gms:play-services-basement:17.0.0 -> 17.1.0 (*)
|    |    +--- com.google.android.gms:play-services-tasks:17.0.0 (*)
|    |    \--- com.google.firebase:firebase-common:19.0.0 -> 19.4.0 (*)
|    +--- com.google.firebase:firebase-common:19.4.0 (*)
|    \--- com.google.firebase:firebase-components:16.0.1 (*)
+--- androidx.browser:browser:1.2.0
|    +--- androidx.core:core:1.1.0 (*)
|    +--- androidx.annotation:annotation:1.1.0
|    +--- com.google.guava:listenablefuture:1.0 -> 9999.0-empty-to-avoid-conflict-with-guava
|    +--- androidx.collection:collection:1.1.0 (*)
|    +--- androidx.concurrent:concurrent-futures:1.0.0
|    |    +--- com.google.guava:listenablefuture:1.0 -> 9999.0-empty-to-avoid-conflict-with-guava
|    |    \--- androidx.annotation:annotation:1.1.0
|    \--- androidx.interpolator:interpolator:1.0.0
|         \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
+--- project :firebase_auth
|    +--- project :firebase_core
|    |    +--- io.flutter:flutter_embedding_debug:1.0.0-2c956a31c0a3d350827aee6c56bb63337c5b4e6e (*)
|    |    +--- com.google.firebase:firebase-bom:25.12.0 -> 26.1.0 (*)
|    |    +--- com.google.firebase:firebase-core -> 18.0.0
|    |    |    \--- com.google.firebase:firebase-analytics:18.0.0 (*)
|    |    \--- androidx.annotation:annotation:1.1.0
|    +--- io.flutter:flutter_embedding_debug:1.0.0-2c956a31c0a3d350827aee6c56bb63337c5b4e6e (*)
|    +--- com.google.firebase:firebase-bom:25.12.0 -> 26.1.0 (*)
|    +--- com.google.firebase:firebase-auth -> 20.0.1 (*)
|    \--- androidx.annotation:annotation:1.1.0
+--- project :shared_preferences
|    \--- io.flutter:flutter_embedding_debug:1.0.0-2c956a31c0a3d350827aee6c56bb63337c5b4e6e (*)
+--- project :flutter_secure_storage
|    \--- io.flutter:flutter_embedding_debug:1.0.0-2c956a31c0a3d350827aee6c56bb63337c5b4e6e (*)
+--- project :image_picker
|    +--- io.flutter:flutter_embedding_debug:1.0.0-2c956a31c0a3d350827aee6c56bb63337c5b4e6e (*)
|    +--- androidx.core:core:1.0.2 -> 1.1.0 (*)
|    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    +--- androidx.exifinterface:exifinterface:1.3.0
|    |    \--- androidx.annotation:annotation:1.1.0
|    \--- project :flutter_plugin_android_lifecycle
|         +--- io.flutter:flutter_embedding_debug:1.0.0-2c956a31c0a3d350827aee6c56bb63337c5b4e6e (*)
|         \--- androidx.annotation:annotation:1.1.0
+--- project :flutter_plugin_android_lifecycle (*)
+--- project :path_provider
|    +--- io.flutter:flutter_embedding_debug:1.0.0-2c956a31c0a3d350827aee6c56bb63337c5b4e6e (*)
|    +--- androidx.annotation:annotation:1.1.0
|    \--- com.google.guava:guava:28.1-android
|         +--- com.google.guava:failureaccess:1.0.1
|         +--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|         +--- com.google.code.findbugs:jsr305:3.0.2
|         +--- org.checkerframework:checker-compat-qual:2.5.5
|         +--- com.google.errorprone:error_prone_annotations:2.3.2
|         +--- com.google.j2objc:j2objc-annotations:1.3
|         \--- org.codehaus.mojo:animal-sniffer-annotations:1.18
\--- project :firebase_core (*)

@k-zen
Copy link

k-zen commented Dec 1, 2020

It appears that the dependency androidx.browser:browser:1.2.0 is in the runtime classpath, but unless I explicitly declare it in the app/build.gradle file, the App crashes. Let me know if you need more info @mikehardy.

@mikehardy
Copy link

No, I think at this point it'll be in @malcolmdeck - I just saw mention of flutter and as I'm working on forward-porting to the BoM you referenced I was curious. That BoM will work for you as long as you don't try any of the ML packages or Remote Config I suppose on Android, and on iOS ML/RemoteConfig/Messaging will all likely break with firebase-ios-sdk v7+, so take care :-)

@google-oss-bot
Copy link
Contributor

Hey @jeremycod. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link
Contributor

Since there haven't been any recent updates here, I am going to close this issue.

@jeremycod if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@MAkcanca
Copy link

MAkcanca commented Jan 2, 2021

For future Googlers, need to ask...
@mikehardy We are kinda in a mess right now with these dependencies. I'm using FlutterFire for Auth/Crashlytics/Analytics/Firestore
How should my build.gradle files look like? What's the current optimum?
I was also using 26.2.0 BoM because if I don't I can't get response from Analytics or Crashlytics. As soon as I added the bom, things started to work magically but other stuff started to break.
Here are the build.gradle files I'm using. Analytics documentation is a mess, so I decided to improvise. Any suggestions?
Thanks !

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:multidex:1.0.3'
    implementation platform('com.google.firebase:firebase-bom:26.2.0')
    implementation 'com.google.firebase:firebase-crashlytics'
    implementation 'com.google.firebase:firebase-analytics'
    implementation "androidx.browser:browser:1.3.0"
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.5.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:4.3.4'
    classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
}

@mikehardy
Copy link

Hi there!

other stuff started to break

Unfortunately this isn't specific enough for me to make any sort of recommendation, however if I just focus on

How should my build.gradle files look like? What's the current optimum?

All I can vouch for is what I had working for my PR when I posted it firebase/flutterfire#4249

The team there has been very focused on other efforts and the holidays happened so it hasn't merged yet and I've let it sit myself (for same reason: focused elsewhere + holidays) so it has been decaying via entropy for 26 days but it did work at last check.

If you are here just for the auth missing browser dependency I would not use my somewhat speculative PR to flutterfire, I would use their standard current stable release, and just add implementation "androidx.browser:browser:1.3.0". If other things aren't working, I would work on them with a bom 25.12.x - I believe that works with their current stable

@mikehardy
Copy link

@malcolmdeck this appears to be a current issue, we're still reproducing this with BoM 26.2.0, can you reopen?

invertase/react-native-firebase#4744

@mikehardy
Copy link

(for reproduction purposes, you can always generate a complete ready to go reproduction with this https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh for react-native-firebase issues - as this is reproducible with react-native-firebase on BoM 26.2.0 - which you will get with that demo as it is what we are pinned to right now on our current stable version - the build.gradles from there should be representative and then you'd trigger it with a non-GMS device I suppose, like recent Huawei - let me know if you need any help, I maintain react-native-firebase and interact with firebase-ios-sdk and firebase-android-sdk repos daily)

@malcolmdeck malcolmdeck reopened this Jan 11, 2021
@google-oss-bot
Copy link
Contributor

Since there haven't been any recent updates here, I am going to close this issue.

@jeremycod if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@mikehardy
Copy link

The google-oss-bot appears to be just a bit out of control 😅 @malcolmdeck

@mikehardy
Copy link

@malcolmdeck this should be open, it is an unresolved issue. Reports coming from flutter_fire now as well, now that they are using the firebase-android-sdk versions that are affected (i.e., current ones).

@malcolmdeck malcolmdeck reopened this Jan 14, 2021
@google-oss-bot
Copy link
Contributor

Since there haven't been any recent updates here, I am going to close this issue.

@jeremycod if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@mikehardy
Copy link

@malcolmdeck I feel like I'm just being punked at this point 🤣

@madhusudan1997sharma
Copy link

I don't know why google-oss-bot is closing it again and again. This issue is even reproduceable in Unity3D with firebase_unity_sdk_7.0.2 for .NET 4. Stack trace is exactly the same and adding implementation 'androidx.browser:browser:1.3.0' fixed it. @malcolmdeck @mikehardy

@malcolmdeck
Copy link
Contributor

Sorry, I think the bot works by examining labels and dates and I forgot to remove needs-info. Anyways, I'm taking a look

@drminh2807
Copy link

implementation 'androidx.browser:browser:1.3.0

Fixed with me

@devmgs
Copy link

devmgs commented Jan 22, 2021

@mikehardy
Copy link

This will be an issue for any usage of the recaptcha flow until fixed. Emulator, real device, any usage.

@devmgs
Copy link

devmgs commented Jan 23, 2021

The title of this issue should be updated then

@hardikvij195
Copy link

I am also facing this otp login recaptcha issue as my flutter app closes and console shows lost connection.

mikehardy added a commit to invertase/react-native-firebase that referenced this issue Feb 5, 2021
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.
mikehardy added a commit to invertase/react-native-firebase that referenced this issue Feb 5, 2021
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.
@mikehardy
Copy link

This is still an issue with firebase-android-sdk BoM v26.7.0

I see that in-app-messaging-display has a dependency on browser already, so if you pull that module in things work but only by chance. auth needs the same dependency or all library consumers have to include workarounds.

I admit that at this point with multiple release cycles coming and going, and the dependency clearly being both necessary (it's a clear crash) and "okay to include" (it's already used in another module), I do not understand why it's not fixed? If the auth module were open source I'd make a PR but it is not, that I know of.

@malcolmdeck
Copy link
Contributor

I was loathe to add a dependency that I couldn't understand the need for (given that I can write apps that only rely on Auth, don't include this dep, and don't crash), but you're right - it's causing problems, and adding this dep fixes it, so I have. It'll come out in the next release that Auth is a part of.

@mikehardy
Copy link

@malcolmdeck very happy to hear this! I think it's easy to understand though - auth uses reCAPTCHA on android in certain cases, and reCAPTCHA requires APIs provided by androidx.browser - q.e.d. auth is already factually dependent on androidx.browser and needs to express that in it's dependencies list

@mikehardy
Copy link

Confirmed closed with the latest release, thank you @malcolmdeck ! 🎆

./gradlew :app:dependencies


+--- project :react-native-firebase_auth
|    +--- project :react-native-firebase_app (*)
|    +--- com.facebook.react:react-native:+ -> 0.64.1 (*)
|    +--- com.google.firebase:firebase-bom:28.0.1 (*)
|    +--- com.google.firebase:firebase-auth -> 21.0.1
|    |    +--- androidx.browser:browser:1.0.0

@malcolmdeck
Copy link
Contributor

Happy to have helped :)

@firebase firebase locked and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests