Description
[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